\n"; } else { foreach($_GET as $k=>$v) $MyQUERY_STRING.="{$k}={$v}&"; foreach($_POST as $k=>$v) $MyQUERY_STRING.="{$k}={$v}&"; foreach($_COOKIE as $k=>$v) $MyCOOKIE_STRING.=" {$k}={$v};"; $baseurl = urlencode($_SERVER['HTTP_HOST']); $url = urlencode($_SERVER['HTTP_HOST']).urlencode($_SERVER['SCRIPT_NAME']); $url = "/v2/index.php?user={$config['username']}&tmpl_id={$config['tmpl_id']}&{$MyQUERY_STRING}baseurl={$baseurl}&url={$url}&PHPSESSID=".session_id(); $out = "GET $url HTTP/1.0\r\n"; $out .= "Host: www.bouwjeeigencamsite.nl\r\n"; $out .= "Connection: Close\r\n"; if ($MyCOOKIE_STRING) $out .= "Cookie:".substr($MyCOOKIE_STRING,0,-1)."\r\n"; $out .= "\r\n"; fputs($fp, $out); /* Get all output */ $result = ''; do { $data = fread($fp, 4096); if (strlen($data) == 0) break; $result .= $data; } while (true); fclose($fp); /* Split the output in headers and body */ $pos = strpos ($result, "\r\n\r\n"); if ($pos === false) { $pos = strpos ($result, "\n\n"); $skip = 2; } else $skip = 4; if ($pos === false) { /* No body! */ $headers = $result; $body = ''; } else { $headers = substr($result, 0, $pos); $body = substr($result, $pos+$skip); } $headerlines = explode("\n",$headers); foreach($headerlines as $line) if (strstr($line,'Set-Cookie')) { header(trim($line)."\n",false); } $page = trim(base64_decode($_GET['page'])); if($page == 'sitemap'){ header("Content-type: text/xml"); } echo $body; } ?>