UNKNOWN
//**************************************
// Name: Proxy, 4 view bloqued pages by fortiguard o firewall
// Description:The code purpose is for all people that are behind a firewall and this one cant let you see some categories or pages because the profile restrictions.
well, the solution is this code. the thing the code do is to: get the content of the page posted, and grab it and finally, display the web page with the server you are running the code. for testing, create an html page, with a form with the method post, and the action property looking to this php code in diferent file. The form need to have a input text box with name of url. (prefer to not run in localhost).
// By: Oliver Leuyim Angel / Curda
//
//
// Inputs:None
//
// Returns:None
//
//Assumes:None
//
//Side Effects:None
//This code is copyrighted and has limited warranties.
//Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.2828/lngWId.8/qx/vb/scripts/ShowCode.htm
//for details.
//**************************************
/m",create_function('$matches','return "";'),$forprint);
print $forprint;
}
}elseif($_GET["url2"] != '')
{
$_GET["url2"] = base64_decode($_GET["url2"]);
$path_parts = pathinfo($_GET["url2"]);
if($path_parts['extension'] == "zip"){
// Define the path to file
$file = $_GET["url2"];
$filesize = filesize($file);
// Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename={$path_parts['basename']}");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$filesize);
// Read the file from disk
readfile($file);
}elseif($path_parts['extension'] == "mp3"){
// Define the path to file
$file = $_GET["url2"];
$filesize = filesize($file);
// Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename={$path_parts['basename']}");
header("Content-Type: application/octet-stream");
//header("Content-type: application/force-download");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$filesize);
// Read the file from disk
readfile($file);
}else{
$parse = parse_url($_GET["url2"]);
$url = "http://".$parse["host"];
$forprint = file_get_contents($_GET["url2"]);
$parts = explode(" ",$forprint);
for($i = 0, $size = sizeof($parts); $i < $size; ++$i)
{
$insertu = substr(trim($parts[$i]),0,6);
if($insertu == 'href="'){
$parts[$i] = str_ireplace('href="',"",$parts[$i]);
$result[1] = rstrstr($parts[$i], '"');
$result[2] = strstr($parts[$i], '"');
$insert = substr(trim($result[1]),0,1);
$insert2 = substr(trim($result[1]),0,4);
if($insert == '/'){ $parts[$i] = "href=\"".$url.$result[1].$result[2]; }
elseif($insert2 != 'http'){ $parts[$i] = "href=\"".$url."/".$result[1].$result[2]; }
else{ $parts[$i] = 'href="'.$result[1].$result[2]; }
}
//////////////////src=""
$insertu = substr(trim($parts[$i]),0,5);
if($insertu == 'src="'){
$parts[$i] = str_ireplace('src="',"",$parts[$i]);
$result[1] = rstrstr($parts[$i], '"');
$result[2] = strstr($parts[$i], '"');
$insert = substr(trim($result[1]),0,1);
$insert2 = substr(trim($result[1]),0,4);
if($insert == '/'){ $parts[$i] = "src=\"".$url.$result[1].$result[2]; }
elseif($insert2 != 'http'){ $parts[$i] = "src=\"".$url."/".$result[1].$result[2]; }
else{ $parts[$i] = 'src="'.$result[1].$result[2]; }
}
}
$forprint = implode(" ",$parts);
$forprint = preg_replace_callback("//m",create_function('$matches','return "";'),$forprint);
print $forprint;
}
}else{
phpinfo();
}
?>