$value) { if($value) { if (substr($name, 0, 5) == 'HTTP_') { $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); $headers[$name] = $value; } else if ($name == "CONTENT_TYPE") { $headers["Content-Type"] = $value; } else if ($name == "CONTENT_LENGTH") { $headers["Content-Length"] = $value; } } } return $headers; } if (!function_exists('apache_response_headers')) { function apache_response_headers () { $arh = array(); $headers = headers_list(); foreach ($headers as $header) { $header = explode(":", $header); $arh[array_shift($header)] = trim(implode(":", $header)); } return $arh; } } echo ($_POST ? "POST " : "GET ").$_SERVER['REQUEST_URI']." HTTP/1.1
"; foreach (emu_getallheaders() as $header => $value) echo "$header: $value
"; if($_POST) { $post = array(); foreach ($_POST as $key=>$val) $post[] = "$key=$val"; echo 'POST: '.implode('&', $post).'
'; } echo '
------------------------------------------------------------------------

'; flush(); $response_headers = apache_response_headers(); echo "HTTP/1.1 ".http_response_code()." OK
"; if(!isset($response_headers['Connection'])) echo "Connection: ".$_SERVER['HTTP_CONNECTION']."
"; if(!isset($response_headers['Content-Encoding'])) { //if(function_exists('ob_gzhandler') && ini_get('zlib.output_compression')) echo 'Content-Encoding: gzip
'; } if(!isset($response_headers['Content-Type'])) //echo "Content-Type: ".($_SERVER['CONTENT_TYPE'] ? $_SERVER['CONTENT_TYPE'] : 'text/html')."
"; echo "Content-Type: text/html; charset=utf8
"; date_default_timezone_set('GMT'); if(!isset($response_headers['Date'])) echo "Date: ".date("D, j M Y G:i:s T")."
"; //echo "Server: ".$_SERVER['SERVER_SOFTWARE']."
"; if(!isset($response_headers['Server'])) echo "Server: nginx
"; if(!isset($response_headers['Content-Length'])) echo "Transfer-Encoding: chunked
"; foreach ($response_headers as $header => $value) echo "$header: $value
"; ?>
BEWS.TK was changed to BEWS.ME