• Log in or sign up for an account here: https://www.sythe.org/login

problem with zip file with php

fighter1431

Forum Addict
Joined
Feb 21, 2007
Sythe Gold
0
Messages
418
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
 
What error does PHP produce when you attempt to run this?

Looks like you just cut this section out of something bigger..
 
Runescape Gamblingrunescape gambling
Back
Top