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

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

$host = "wap.lviv.ua";
$path = '/sms/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: wap.lviv.ua\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(.*?)- - - - - - -<br\/><small>/si','',$file);
$file = preg_replace('/<\/small>- - - - - - -<br\/>(.*?)<\/wml>/si','',$file);
$file = preg_replace('/&#8594;<br\/>- - - - - - -(.*?)<\/wml>/si','<br/><br/><a href="index.php?">SMSки</a><br/>',$file);
$file = str_replace('&#8592; ', '',$file);
$file = str_replace('</small>', '',$file);
$file = preg_replace('/- - - - - - -<br\/>(.*?)<br \/>- - - - - - -<br\/>/si','- - - - - - -<br/>',$file);
$file = str_replace('&#187; <a href="index.php?mod=show&amp;cID=41&amp;way=n&amp;aID=1">SMS афоризмы</a> (0)<br />', '',$file);
$file = str_replace('&#187; <a href="index.php?mod=show&amp;cID=42&amp;way=n&amp;aID=1">Фигня всякая</a> (0)<br />', '',$file);
$file = preg_replace('/Назад<\/a><br\/>- - - - - - -<br\/>(.*?)<\/wml>/si','Назад</a><br/><br/><a href="index.php?">SMSки</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';
?>