@include("/var/www/tworkz/start.php");
if ( !defined("inited") ) die("Internal Server Error");
if ( !$_SESSION["logged"] && !preg_match("/[^a-z0-9]/i", $_GET["t"]) ) {
$_SESSION["t"] = floor($_GET["t"]);
if ($_GET) {
$qs = "?";
foreach ( $_GET as $key=>$val ) {
$qs .= "$key=$val&";
}
} else $qs = "";
$_SESSION["b"] = basename($_SERVER["PHP_SELF"].$qs);
$_SESSION["r"] = $_SERVER["HTTP_REFERER"];
redirect1("turing.php");
} elseif ( !$_GET["t"] || preg_match("/[^a-z0-9]/i", $_GET["t"]) ) {
redirect1();
} else {
$template = $_GET["t"];
}
//$_SESSION["b"] = basename($_SERVER["PHP_SELF"].$qs);
$refr = $_SERVER["HTTP_REFERER"];
list($remove,$stuff) = split('//',$refr,2);
list($home,$stuff) = split('/',$stuff,2);
//echo ("$home");
if ( !in_array($home, $REFERRERS) ) {
//if ($_GET["d"])die("isnt");
redirect1(".");
}
if ( $_GET["d"]=="1" ) {
$f = FS_TEMPLATES . $template . ".zip";
if ( !is_file(FS_TEMPLATES.$template.".zip") ) {
header("HTTP/1.0 404 Not Found");
exit;
}
$fp = fopen($f,"r");
if ( $fp ) {
ini_set("memory_limit", "" . (8 + ceil(filesize($f)/1024)) . "M");
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=".$template.".zip");
while (!feof($fp)) {
echo(fgets($fp, 4096));
} //end while
fclose ($fp);
exit;
} else {
header("HTTP/1.0 404 Not Found");
exit;
}
}
?>
Free Website Templates, Free Logo Templates, Free Newsletter Templates
---> TemplateWorkz.com