","<",",","\\","/"); $url = html_entity_decode(strip_tags($url)); if($lowercase){ $url = strtolower($url); } if($non_breaking_space){ $url = str_replace(" ", "-", $url); } if($ampersand){ $url = str_replace("&", "en", $url); } if($point){ $replaceArray[] = "."; } if($underscore){ $url = str_replace("_", "-", $url); } if($colon){ $replaceArray[] = ":"; } $url = str_replace($replaceArray, "", $url); return $url; } /*if(substr($_SERVER['HTTP_HOST'], 0, 4) != "www."){ header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".$_SERVER['HTTP_HOST']."/".$_GET['get']); exit(); }*/ session_start(); $path = $_SERVER['DOCUMENT_ROOT']; $path_data = $_SERVER['DOCUMENT_ROOT']."/data/"; if(!is_dir($path_data)){ echo ""; } elseif(!is_writable($path_data)){ echo ""; } elseif(!is_file($path."/.htaccess")){ echo ""; } elseif(!is_file($path."/favicon.ico")){ echo ""; } if(empty($_SESSION['cookie'])){ $time = time(); $_SESSION['cookie'] = $time."_".rand(1,$time).".log"; $time -= 60*60*24*7; if(is_dir($path_data)){ if($handle = opendir($path_data)){ while(($file = readdir($handle)) !== false){ $fileParts = pathinfo($path_data.$file); if(filetype($path_data.$file) == file && $fileParts['extension'] == "log"){ $fileArray = explode("_", $file); if($fileArray[0] < $time){ unlink($path_data.$file); } } } closedir($handle); } } } $curl = curl_init(); $temp = array(); $get = "/".$_GET['get']; if(count($_GET) > 1){ array_shift($_GET); foreach($_GET as $key => $value){ $temp[] = $key."=".$value; } $get .= "?".implode("&", $temp); } $host = $_SERVER['HTTP_HOST']; if(substr($_SERVER['HTTP_HOST'], 0, 4) != "www."){ $host = "www.".$_SERVER['HTTP_HOST']; } //echo $host; curl_setopt($curl, CURLOPT_URL, "http://www.view.web-stage.nl/".$host."/".$get); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_COOKIEJAR, $path_data.$_SESSION['cookie']); curl_setopt($curl, CURLOPT_COOKIEFILE, $path_data.$_SESSION['cookie']); if(!empty($_FILES)){ //curl_setopt($curl, CURLOPT_SAFE_UPLOAD, true); foreach($_FILES as $key => $value){ $file = upload_file($key); $_POST[$key] = "http://".$host."/data/".$file[1]; } } if(!empty($_POST)){ curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($_POST)); } if(ini_get('open_basedir') == "" && ini_get('safe_mode') == "Off"){ curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true); $content = curl_exec($curl); } else{ $content = curl_redir_exec($curl); } if(substr(str_replace(array("\n","\r", "\t"), "", $content), 0, 7) == ""){ $content = "<!DOCTYPE HTML> <html> <head>".$content; } //$content = curl_exec($curl); echo $content; ?>