i have a tutorial from a website Net Tuts which is used to upload a zip file and extract the data from within the file into the server.
copying and pasting the code straight from the web page did not work, an error occured half way through the script being processed.
Fatal error: Cannot instantiate non-existent class: ziparchive in /www/website_here.co.uk/httpdocs/test/functions.php on line 6
is it possible that this is to do with the version of PHP i am using. here is the code it gets stuck on
<?php
function openZip($file_to_open) {
global $target;
global $unique_folder;
$zip = new ZipArchive();
$x = $zip->open($file_to_open);
if ($x === true) {
$zip->extractTo($target . $unique_folder);
$zip->close();
unlink($file_to_open); #deletes the zip file. We no longer need it.
} else {
die("There was a problem. Please try again!");
}
}
?>
line 6: $zip = new ZipArchive();
i am using PHP version 4.3.9, Thanks for any help!