Ich versuche Bild dynamisch zu laden. Der HTML-Code ist:move_uploaded_file() Funktion zeigt Fehler
<form method="post" action="" name="form1" id="form1" enctype="multipart/form-data">
<label for "file">Select Picture</label><br>
<input type="file" name="file" id="file"><br>
<input type="hidden" value="<?php echo $_POST['pic'];?>" name="pic">
<input type="submit" value="Upload" name="upload" id="upload"><br>
</form>
After I write the following code it is showing me the error: " move_uploaded_file() [function.move-uploaded-file]: The second argument to copy() function cannot be a directory " and "Unable to move 'C:\xampp\tmp\phpB67C.tmp' to 'images/' ". The php code for this is:
if(isset($_POST['upload'])){
$pic=$_POST['pic'];
move_uploaded_file($_FILES["file"]["tmp_name"], "images/".$pic); //."jpg");
}
Bitte sagen Sie mir, wie der Fehler zu entfernen und in der Lage sein, das Bild hinzuzufügen und anzuzeigen.
Was bedeutet print_r ($ _ POST); gebe dir? – Sebastian
es gibt mir Array ([pic] => [Upload] => Upload) – Shreya
ändern isset ($ _ POST [ 'upload']) isset ($ _ FILES [ 'upload']) –