Jump to content

cotede2

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cotede2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://seabova.com/zip.php /home/content/s/e/a/seabova/html/idxphotos.zip Warning: fopen(/538368a.jpg) [function.fopen]: failed to open stream: Permission denied in /home/content/s/e/a/seabova/html/zip.php on line 34 Hello , I 'd like from a php script to be able to unzip to extract an archive. This is the script : <?php function mkdir_recursif($dir) { $parties = preg_split('#/' . preg_quote(DIRECTORY_SEPARATOR) . '#', $dir, -1, PREG_SPLIT_NO_EMPTY); $base = ''; foreach ($parties as $p) { if (!file_exists($base . $p)) { mkdir($base . $p); } $base .= $p . DIRECTORY_SEPARATOR; } } function extractTo($archive, $destination, $ecrase = FALSE, $fichiers = NULL) { if (($zip = zip_open($archive)) === FALSE) { die(var_dump($zip)); return FALSE; } if (!file_exists($destination)) { mkdir_recursif($destination); } while ($entree = zip_read($zip)) { $fichier = zip_entry_name($entree); if (is_array($fichiers) && !in_array($fichier, $fichiers)) { continue; } if (zip_entry_open($zip, $entree)) { $contenu = zip_entry_read($entree, zip_entry_filesize($entree)); zip_entry_close($entree); if ($ecrase !file_exists($destination . DIRECTORY_SEPARATOR . $fichier)) { if (strpos($fichier, '/') !== FALSE) { mkdir_recursif($destination . DIRECTORY_SEPARATOR . dirname($fichier)); } $fp = fopen($destination . DIRECTORY_SEPARATOR . $fichier, 'w'); fwrite($fp, $contenu); fclose($fp); } } else { zip_close($zip); return FALSE; } } zip_close($zip); return TRUE; } $path = '/home/content/s/e/a/seabova/html/idxphotos.zip'; echo $path; # Exemples d'utilisation # Extraction de l'ensemble des fichiers qui composent l'archive extractTo( $path, ''); /* $path = '/home/content/s/e/a/seabova/html/idxfullphotos.zip'; extractTo( $path, ''); */ ?> On my localhost, it works well (windows XP + easyphp) but not on my host. zip.php is chmoded 777 as are also the folders idxphotos and idxfullphotos so I don't get it. thanks for your help.
  2. print_r is nice it displays a display with all the data. Array ( [0] => 548084 [MLSNumber] => 548084 [1] => 184900 [PriceListing] => 184900 [2] => BROADKILL HUNDRED [Area] => BROADKILL HUNDRED [3] => A [statusActual] => A [4] => BETWEEN RT. 1 & 113 [section] => BETWEEN RT. 1 & 113 [5] => DUORY CIRCLE [AddressStreetName] => DUORY CIRCLE [6] => MILTON [AddressCity] => MILTON [7] => [AddressUnitNumber] => [8] =>
  3. I dont get it . what javascript has to do with it? I could echo what?
  4. Hello , in PHP , I'd like with only a few lines to get all data from a table without the obligation to specify the number of fields and their names. I got like 200 fields multiply by 12 tables ... So if the structure is liek that: FName LName Age while($e = mysql_fetch_array($query)){ //code I am looking for } Displays Fname => dupond Lname => arthur Age => 18 .. thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.