Ich habe dieses Bild Upload-Skript.Code in ein Texteingabeformular eingeben, wie?
<?php
if(isset($_POST['submit'])){
if (isset ($_FILES['new_image'])){
$imagename = $_FILES['new_image']['name'];
$source = $_FILES['new_image']['tmp_name'];
$target = "temporary_images/".$imagename;
move_uploaded_file($source, $target);
$imagepath = $imagename;
$save = "temporary_images/" . $imagepath; //This is the new file you saving
$file = "temporary_images/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 350;
$modheight = 100;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
$save = "temporary_images/sml_" . $imagepath; //This is the new file you saving
$file = "temporary_images/" . $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 80;
$modheight = 100;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
echo "Large image: <img src='temporary_images/".$imagepath."'><br>";
}
}
brauche ich das Skript den Namen der Datei, in der Form zu schreiben
<form>
<input name="animeinput" id="animeinput" size="20" class="textbox">
</form>
Also im Grunde i meinen Upload-Skript benötigen $ imagepath (die Dateinamen, das zum Speichern des Bildes verwendet wird) zu schreiben in das Formular, wenn ein Bild hochgeladen wurde.
Wie mache ich das?
Sie reichen also das Formular ein (das das Bild hochlädt), das Sie auf eine andere Seite bringt. Soll der Dateiname, der zum Speichern des Bildes verwendet wird, auf der neuen Seite angezeigt werden? – JorenB
Dies wurde vor ein paar Stunden gefragt http://stackoverflow.com/questions/1321256/type-code-in-to-a-text-input-form-how/ –
Ja, genau. in der Form. –