I haev some problems with the code for my website that is suppossed to extract a zipfile and then put al lthe names of the entries in a mysql databse.
Could someone please tell me what I did wrong and correct this code?
Code:
elseif ($_POST['nieuwefotosubmit']) {
$file = $_FILES['file']['name'];
$fileplaats = "fotos/".$file;
$target_path = "fotos/";
$target_path = $target_path . basename( $_FILES['file']['name']);
$move1=move_uploaded_file($_FILES['file']['tmp_name'], $target_path);
$error = $_FILES['file']['error'];
if (!$move1) {
$content = "Het is niet gelukt om ".$file." te uploaden <br
/>".$error."<br />";
} else {
$content .= "Het is gelukt om ".$file." te uploaden.<br />";
}
if(!$include=include_once("pclzip.lib.php")) {
die('Error'.$include->errorInfo(true));
}
$zip = new PclZip($fileplaats);
if (($lijst = $zip->listContent()) == 0)
die ('Error '.$zip->errorInfo(true));
$i = 0;
while ($i < sizeof($lijst)) {
$naam = $lijst[$i]['filename'];
$fotograaf = $login;
$comment = "";
$query200 = mysql_query("INSERT INTO fotos (naam, date, comment,
fotograaf) VALUES ('$naam', '$date', '$comments', '$login')");
$error = mysql_error();
if (!$query200) {$content = $error;}
}
}
thx in andvance
fighter1431