Показать сообщение отдельно

  #787  
Старый 12.06.2009, 11:01
Failure
Участник форума
Регистрация: 21.09.2008
Сообщений: 148
С нами: 9282050

Репутация: 102
По умолчанию

proxy.php:
PHP код:
<?php
############
#    Граббер проксей с ip-whois.net
#    (ип;порт;дата;страна;анонимная/прозрачная) 
#    запись натыренного в файл (proxy.html)
#    (c) Failure
############
error_reporting(0);
set_time_limit(30);
if(!
file_exists("proxy.html")) include("get_proxy.php");

 
$f = fopen("proxy.html","r");
   
$buff = fread($f, filesize("proxy.html"));
   
$buff = strstr($buff, "<table width = 100%>");
   
$bad = strstr($buff, "</tr></table></p>");
   
$buff = str_replace($bad, "", $buff);
 
fclose($f);
 echo 
$buff;
 if(
file_exists("proxy.html")) unlink("proxy.html");
 
$f = fopen("proxy.html","a+");
   
fwrite($f, $buff);
 
fclose($f);
?>
get_proxy.php
PHP код:
<?php
 $sock 
= fsockopen("ip-whois.net", 80, $bla, $bla2);

 
$out = "GET /proxy.php HTTP/1.1\r\n";
 
$out .= "Host: ip-whois.net\r\n";
 
$out .= "Content-Type: text/html\r\n";
 
$out .= "Referer: http://ip-whois.php/index.php\r\n\r\n";
 
 
fwrite($sock, $out);

 if(
file_exists("proxy.html")) unlink("proxy.txt");

 
$fproxy = fopen("proxy.html","a+");

 while(!
feof($sock)) fwrite($fproxy, fgets($sock, 1000));

 
fclose($sock);fclose($fproxy);
?>
 
Ответить с цитированием