0
<form name="property" action="" method="post" enctype="multipart/form-data">
Select Image
<input type="file" name="upload[]" multiple="multiple" id="image"/>
<input type="submit" value="Submit" name="submit" style="width:200px; height:30px;" />
</form>
MY Php Code:Problem beim Hochladen mehrerer Bilder? db Bild angehängt
if(isset($_POST['submit']))
{
$total = count($_FILES['upload']['name']);
for($i=0; $i<$total; $i++)
{
$tmpFilePath = $_FILES['upload']['tmp_name'][$i];
if ($tmpFilePath != "")
{
$newFilePath[] = "upload/" . $_FILES['upload']['name'][$i];
$values_insert = implode(',', $newFilePath);
if(move_uploaded_file($tmpFilePath, $newFilePath))
{
$date=date("Y-m-d");
}
}
}
$d=mysql_query("INSERT INTO properties (iname,cdate) VALUES('".$values_insert."',NOW())") or die(mysql_error());
}
Hinweis:
In Datenbank den Pfad Upload-Verzeichnis Ordner und Bild Bild wird auf die Datenbank gehen, ich will nur Name Bild getrennt durch Komma. Zum Beispiel ist die erwartete Ausgabe Chrysanthemum.jpg, Desert.jpg. Ich weiß nicht, was das Problem ist. Bitte führe mich. Schau dir meine Code- und Bildanhangsdetails an.