note 95605 added to function.fsockopen
| From: | nytro_rst at yahoo dot com | Date: | Tue, 12 Jan 2010 10:26:33 +0000 |
| Subject: | note 95605 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164872@lists.php.net to get a copy of this message | ||
A simple proxy list checker. You can check a list ip:port if that port is opened on that IP.
<?php
$fisier = file_get_contents('proxy_list.txt'); // Read the file with the proxy list
$linii = explode("\n", $fisier); // Get each proxy
$fisier = fopen("bune.txt", "a"); // Here we will write the good ones
for($i = 0; $i < count($linii) - 1; $i++) test($linii[$i]); // Test each proxy
function test($proxy)
{
global $fisier;
$splited = explode(':',$proxy); // Separate IP and port
if($con = @fsockopen($splited[0], $splited[1], $eroare, $eroare_str, 3))
{
fwrite($fisier, $proxy . "\n"); // Check if we can connect to that IP and port
print $proxy . '<br>'; // Show the proxy
fclose($con); // Close the socket handle
}
}
fclose($fisier); // Close the file
?>
----
Server IP: 69.147.83.197
Probable Submitter: 86.126.116.107
----
Manual Page -- http://www.php.net/manual/en/function.fsockopen.php
Edit -- https://master.php.net/note/edit/95605
Del: integrated -- https://master.php.net/note/delete/95605/integrated
Del: useless -- https://master.php.net/note/delete/95605/useless
Del: bad code -- https://master.php.net/note/delete/95605/bad+code
Del: spam -- https://master.php.net/note/delete/95605/spam
Del: non-english -- https://master.php.net/note/delete/95605/non-english
Del: in docs -- https://master.php.net/note/delete/95605/in+docs
Del: other reasons-- https://master.php.net/note/delete/95605
Reject -- https://master.php.net/note/reject/95605
Search -- https://master.php.net/manage/user-notes.php