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

Размер файла: 2.22Kb
<?php
/*
mod by denich
*/

$host = "kengu.ru";
$path = '/kamasutra/index.php?'.$_SERVER['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: kengu.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"?>', '',$file);
$file = preg_replace('/<!DOCTYPE(.*?)<div class="main" style="text-align: left">/si','',$file);
$file = str_replace('</div>', '',$file);
$file = str_replace('<div>', '',$file);
$file = str_replace('<span class="text3">', '',$file);
$file = str_replace('</span>', '',$file);
$file = str_replace('<div class="sec">', '',$file);
$file = preg_replace('/<a href="http:\/\/kengu.ru" class="link3">(.*?)<\/html>/si','',$file);
$file = str_replace('Выберите раздел', '',$file);
$file = str_replace('<img src="images', '<br/><img src="http://kengu.ru/kamasutra/images',$file);
$file = str_replace('Камасутра от КЕНГУ.РУ', 'load',$file);
$file = str_replace('<div class="ten">', '<br/>',$file);
$file = str_replace('<span style="color:#ffffff;">', '',$file);
$file = str_replace(' class="link3"', '',$file);
$file = str_replace(' style="margin:0px"', '',$file);
$file = str_replace(' class="but"', '',$file);
$file = str_replace('<a href="http://kengu.ru/kamasutra/', '<br/><a href="',$file);
$file = preg_replace('/<form(.*?)<\/form>/si','<br/>',$file);
$file = preg_replace('/Назад<\/a><br\/>- - - - - - -<br\/>(.*?)<\/wml>/si','Назад</a><br/><br/><a href="index.php?">Камасутра</a><br/>',$file);
$file = str_replace('<a href="index.php?', '<a href="index.php?site='.$site.'&amp;tcolor='.$tcolor.'&amp;fcolor='.$fcolor.'&amp;lcolor='.$lcolor.'&amp;',$file);

include '../head.php';

echo $file;

include '../foot.php';
?>