File size: 893B
<?php
error_reporting(0);
header("Cache-Control: no-cache");
include 'connect.php';
include 'functions.php';
$p=@$_GET['p'];
$p=valid_number($p);
$res2=mysql_query("SELECT *
FROM `category`
WHERE `id`='$p'
LIMIT 1");
$arr = mysql_fetch_assoc($res2);
$dec=urldecode($arr['array']);
$dec=unserialize($dec);
$f=$_GET['f'];
$f=valid_number($f);
if (!is_file($dec[$f]))
{echo 'File not found 404!';
exit();}
include 'pclzip.lib.php';
$f_n=str_replace($_SERVER['DOCUMENT_ROOT'],'',$dec[$f]);
$zip_file=str_replace("/","_",$f_n);
if (is_file('zip/'.$zip_file.'.zip'))
{header('Location: http://'.$_SERVER['HTTP_HOST'].$folder.'/zip/'.$zip_file.'.zip');}
else
{
$archive = new PclZip('zip/'.$zip_file.'.zip');
$v_list = $archive->create($dec[$f],PCLZIP_OPT_REMOVE_ALL_PATH);
header('Location: http://'.$_SERVER['HTTP_HOST'].$folder.'/zip/'.$zip_file.'.zip');
}
?>