Размер файла: 2.05Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
if (empty($_GET['s'])) $s = 1;
if (empty($_GET['p'])) $p = 1;
$host = "wap.wab.ru";
$path = "/downloads/video.php?p=$p&s=$s";
$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 .= "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($text != "\r\n") $text = fgets($fp,128);
$text = "";
while(!feof($fp)) $text .= fgets($fp,4096);
fclose($fp);
}
//$text = join('', file("http://www.wab.ru/downloads/video"));
$next = ereg(">>", "$text");
$back = ereg("<<", "$text");
$text = explode("</head>",$text); // отрезаем перед
$text = $text[1];
$text = explode("</div>",$text); // отрезаем перед
$text = $text[2];
$text = str_replace("video.php","http://wap.wab.ru/downloads/video.php",$text);
$text = str_replace("video_1/","http://wap.wab.ru/downloads/video_1/",$text);
$text = str_replace("scr","Loading ",$text);
$text = strip_tags($text, "<a><br/><img>");
if (empty($_GET['s'])) $s = 1;
header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
print "<wml>";
print "<card id=\"index\" title=\"LoaD\">";
print "<p>";
print "$text";
print "<br/>******<br/>";
if ($back == true) print "<a href=\"video.php?p=$p&s=".($s - 1)."\"><small>Назад</small></a>|";
//$start < 400
if($next == true)print "<a href=\"video.php?p=$p&s=".($s + 1)."\"><small>Вперед</small></a>";
print "<br/>******<br/>";
print "<a href=\"http://mas.net.ru\">Mas.Net.Ru</a>";
print "</p></card></wml>";
?>