$br = array( |
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)', |
'Opera/9.50 (Windows NT 5.1; U; ru)', |
'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1b3) Gecko/20090304 Firefox/3.1b3 ' |
); |
|
$browser = trim($br[array_rand($br)]); |
|
$host= "html.masyaka.ru"; |
$path="/servis/sms/index.php?".$_SERVER['QUERY_STRING']; |
$fp=fsockopen($host,80,$errno, $errstr,10); |
if(!$fp) { echo "$errstr ($errno)<br/>\n"; }else{ |
$data = "";$post=0; foreach($_POST as $key=>$value){ |
$post=1; $data.="&$key=$value";} if($data)$data=substr($data,1); |
if($post) $headers = "POST $path HTTP/1.0\r\n";else |
$headers = "GET $path HTTP/1.0\r\n"; |
$headers .= "Host: $host\r\n"; |
$headers .= "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif,image/x-bitmap, */*;q=0.1\r\n"; |
$headers .= "Accept-Charset: utf-8;q=0.6 windows-1251;q=0.1*;q=0.1\r\n"; |
$headers .= "Accept-Encoding: utf-8\r\n"; |
$headers .= "Accept-Language: ru, en;q=0.9\r\n"; |
$headers .= "Referer: html.masyaka.ru\r\n"; |
$headers .= "User-Agent: ".$browser."\r\n";// |
if($post){ $headers .= "Content-type: application/x-www-form-urlencoded\r\n"; |
$headers .= "Content-Length: ".strlen ($data)."\r\n"; |
$headers .= "\r\n"; $headers .= $data;}else $headers.="\r\n"; |
@fwrite($fp, $headers); while($ifmod != "\r\n") $ifmod = @fgets($fp, 128); |
$ifmod = ''; while(!feof($fp)) $ifmod .= @fgets($fp, 4096); @fclose($fp); } |
|
|
################################################### |
################################################## |
$ifmod = str_replace('>',">\n",$ifmod); |
$ifmod = str_replace('<?xml version="1.0" encoding="utf-8"?>','',$ifmod); |
$ifmod = preg_replace('|<!DOCTYPE(.*?)<body(.*?)>|isu','',$ifmod); |
$ifmod = preg_replace('|<!--(.*?)-->|isu','',$ifmod); |
$ifmod = str_replace('<img src="/page/index?make','<img src="http://html.masyaka.ru/page/index?make',$ifmod); |
$ifmod = str_replace('index.php','send2.php',$ifmod); |
|
$ifmod = str_replace("<hr />\n",'',$ifmod); |
$ifmod = str_replace("\n\n","\n",$ifmod); |
$ifmod = str_replace('<form method="post" action="post.php?make=send">','<form method="post" action="'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'">',$ifmod); |
$ifmod = preg_replace('|</form>(.*?)</html>|is','',$ifmod); |
$ifmod = str_replace('<img src="img/','<img src="http://html.masyaka.ru/servis/sms/img/',$ifmod); |
$ifmod = preg_replace('|<a href="(.+)/super/(.*?)>(.*?)</a>|isu','',$ifmod);// |
$ifmod = preg_replace('|<a href="send2.php?PHPSESSID(.*?)>(.*?)</a>|is','<a href="send2.php" title="">Отправить еще</a>',$ifmod);// |
$ifmod = str_replace('','',$ifmod); |
|
echo $ifmod; |