Просмотр файла index.php

Размер файла: 1.32Kb
<?php
error_reporting(0);

include('head.php');
$host = "bazooka.h2m.ru";
$path = "/7b/auto/auto/auto/auto/?$QUERY_STRING";
$fp = fsockopen($host,80,$errno,$errstr,30);
if(!$fp) echo"$errstr ($errno)<br />\n";
else{
$headers .= "GET $path HTTP/1.0\r\n";
$headers .= "Host: $host\r\n";
$headers .= "Accept: *\r\n";
$headers .= "Accept-Charset: UTF-8\r\n";
$headers .= "Accept-Charset: *\r\n";
$headers .= "Accept-Encoding: deflate\r\n";
$headers .= "Accept-Language: ru\r\n";
$headers .= "Referer: waping.ru\r\n";
$headers .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01\r\n\r\n";
fwrite($fp,$headers);
while($file != "\r\n") $file = fgets($fp,128);
$file = "";
while(!feof($fp)) $file .= fgets($fp,4096);
fclose($fp);
}



$file = str_replace('<?xml version="1.0" encoding="UTF-8" ?>', '<!-- Bazket -->',$file);
$file = preg_replace('/<!DOCTYPE(.*?)<div class=\'topnav\'>/si','',$file);
$file = preg_replace('/<a href=\'\/wap2.0\/\' accesskey=\'0\'>(.*?)<\/html>/si','',$file);
$file = str_replace('</div><div class=\'body\'>', '<br />',$file);
$file = str_replace('<a href=\'/wap2.0/catalogs/autocat/', '<a href=\'?baz=',$file);
$file = str_replace('</div><div class=\'downnav\'>', '<br />',$file);
$file = str_replace('?brend', '&amp;brend',$file);

echo $file;
include('foot.php');
?>