File size: 1.86Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
header("Content-type:text/html;charset=utf-8");
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
include ('../color.php');
if (empty($_GET['s'])) $s = 1;
if (empty($_GET['l'])) $l = 1;
if (empty($_GET['t'])) $t = 1;
if (empty($_GET['in'])) $in = 1;
$host = "wap.wab.ru";
$path = "/downloads/melodies.php?t=$t&l=$l&s=$s&in=$in";
$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/1.xml"));
$next = ereg(">>", "$text");
$back = ereg("<<", "$text");
$text = explode("</head>",$text); // отрезаем перед
$text = $text[1];
$text = explode("</div>",$text); // отрезаем перед
$text = $text[2];
$text = str_replace("melodies.php","http://wap.wab.ru/downloads/melodies.php",$text);
$text = strip_tags($text, "<a><br/><b>");
include "../head.php";
print "$text";
print "<br/>$br";
if ($back == true) print "<a href=\"melodies.php?in=$in&t=$t&l=$l&s=".($s - 1)."\"><small>Назад</small></a> |";
if($next == true) print "<a href=\"melodies.php?in=$in&t=$t&l=$l&s=".($s + 1)."\"><small>Вперед</small></a><br/>";
print "<br/>$br ";
print "$homeurl";
include "../foot.php";
?>