<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';


include_once '../sys/inc/thead.php';
aut();

$host='spaces.ru';

$path='/mysite/';
if(isset($_POST['word']))
{
$word=$_POST['word'];
$data='word='.$word.'?name=CECTEMfl&password=toptop';
}
$host='spaces.ru';
$path='/music/';
if(isset($_POST['word']))
{
$word=$_POST['word'];
$data='word='.$word.'&search=1';
}
else
{
$data=''.$_SERVER['QUERY_STRING'].'';
}
$fp = @fsockopen("tcp://".$host, 80, $errno, $errstr, 10);
if (!$fp)
{
die($errstr.':'.$errno);
}
else
{
$out  = "POST $path?$_SERVER[QUERY_STRING] HTTP/1.0\r\n";
$out .= "Host: $host\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Content-Length: ". strlen($data) ."\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out.$data);
$headers='';
while ($str = trim(fgets($fp, 4096)))
$headers .= "$str\n";
$body='';
while (!feof($fp))
$body.= fgets($fp, 4096);
fclose($fp);
}
$body = preg_replace('|<?(.*)dtd">|sU', '',$body);
$body = preg_replace('|<html(.*)<body>|sU', '',$body);
$body = preg_replace('|<div class="footer">(.*)</div>|sU', '',$body);
$body = preg_replace('|<div class="busi">(.*)</a><br/></div>|sU', '',$body);
$body = preg_replace('|<span style="font-size:small;font-weight:bold">(.*)<br/></span>|sU', '',$body);
$body = preg_replace('|<div style="background-color:#CCFFCC;border-top:1px solid #006600;border-bottom:1px solid #006600;padding:2px">(.*)</html>|sU', '',$body);
$body = preg_replace('|<div style="font-size:small;background-color:#FFCC66">(.*)</html>|sU', '',$body);
$body = ereg_replace("http://spaces.ru/music/", "", $body);
echo $body;

include_once '../sys/inc/tfoot.php';
?>

