Example #1
0
function redirects($type, $url, $time = 0)
{
    if ($type != "location" && $type != "refresh") {
        $type == "location";
    }
    if ($type == "refresh") {
        header("Refresh: " . $time . "; URL=" . $url);
    }
    if ($type == "location") {
        idb_log_maker(302, "-");
    }
    if ($type == "location") {
        header("Location: " . $url);
    }
    return true;
}
Example #2
0
function gzip_page($use_gzip = "off", $gzip_type = "gzip")
{
    global $Settings, $urlstatus;
    if (!isset($urlstatus) || !is_numeric($urlstatus)) {
        $urlstatus = 200;
    }
    $output = trim(ob_get_clean());
    if ($gzip_type != "gzip") {
        if ($gzip_type != "deflate") {
            $gzip_type = "gzip";
        }
    }
    if ($use_gzip != "on") {
        if ($Settings['send_pagesize'] == "on") {
            @header("Content-Length: " . decoct(strlen($output)));
            @header("Content-MD5: " . base64_encode(md5($output)));
        }
        idb_log_maker($urlstatus, strlen($output));
        echo $output;
    }
    if ($use_gzip == "on") {
        if ($gzip_type == "gzip") {
            $goutput = gzencode($output);
        }
        if ($gzip_type == "deflate") {
            $goutput = gzcompress($output);
        }
        if ($Settings['send_pagesize'] == "on") {
            @header("Content-Length: " . decoct(strlen($goutput)));
            @header("Content-MD5: " . base64_encode(md5($goutput)));
        }
        idb_log_maker($urlstatus, strlen($goutput));
        echo $goutput;
    }
}