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

Размер файла: 2.44Kb
<?php 
##############################################
function query($url,$sq='') { $curl = curl_init(); 
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_USERAGENT,'NokiaN73-1'); 
curl_setopt($curl,CURLOPT_REFERER,'http://$_SERVER[HTTP_HOST]/');
if(!empty($sq)) { curl_setopt($curl,CURLOPT_POSTFIELDS,'sq='.$sq); }
curl_setopt($curl,CURLOPT_AUTOREFERER,false);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_TIMEOUT,30); $result = curl_exec($curl); 
curl_close($curl);  if(!$result) 
##############################################

{ echo 'Сервис временно недоступен.<br />'; foot(); exit; } return $result; }

if(isset($_POST['sq'])) {

##############################################
$result=query('http://wap.horo.mail.ru/?'.$_SERVER['QUERY_STRING'],$_POST['sq']);
}else{
$result=query('http://wap.horo.mail.ru/?'.$_SERVER['QUERY_STRING']); }
##############################################


##############################################
$result = preg_replace('|<head>(.*)</head>|sU', '',$result);
$result = str_replace('<body>','',$result);
$result = preg_replace('|<div id="header" class="top">(.*)</a></div>|sU', '',$result);
$result = preg_replace('|<div>Реклама:(.*)</a>|sU', '',$result);
$result = preg_replace('|<a (.*) href="http://r.mail.ru(.*)</a>|sU', '',$result);
$result = preg_replace('|<h1 class="horo">Индивидуальные гороскопы</h1>(.*)</div>|sU', '',$result);
$result = str_replace('<h1>Зодиакальный гороскоп</h1>','',$result);
$result = str_replace('/index.html','index.php',$result);
$result = str_replace('/prediction.html','prediction.php',$result);
$result = str_replace('/img/zodiac/','img/',$result);
$result = preg_replace('|<div id="footer"(.*)>(.*)</a></div>|sU', '',$result);
$result = str_replace('<div></div>','',$result);
$result = preg_replace('|<div class=(.*)>(.*)|sU', '<div>',$result);


$result = preg_replace('/<?xml version(.*)Все знаки<\/a><\/p>/si', '',$result);
$result = preg_replace('/<a href=\"index.php(.*)<\/html>/si', '',$result);



##############################################


##############################################
$result = str_replace('<p>&#032;</p>','',$result);
$result = str_replace('<p>&#032;</p><br/>','',$result);
$result = str_replace('<div class="adds">
</div>','',$result);
##############################################
echo $result;

 exit; ?>