this code is strange !


Posted on 16th Feb 2014 07:03 pm by admin

Hi i got this code from the web.. It checks for live and dead socks
It is working perfectly on my localhost. but does not work in any webserver ! any ideas ?


<?php
$filename = "proxies.txt"; //or a localpath.
$rel=file_get_contents($filename);
$ipset = explode("n",$rel); // explode it based on your delimiter.
foreach($ipset as $ips)
{
$ipandport=explode(':',$ips);
//Porxy string format might be 123.156.189.112:8080
$host=$ipandport[0];
$i=(int)$ipandport[1];
$fp = @fsockopen("tcp://".$host,$i,$errno,$errstr,10);
// tcp:// because, socks4 uses TCP and socks5 uses TCP & UDP
if($fp)
{
echo("Result is $fp");
echo ("port " . $i . " open on " . $host . "");
fclose($fp);
}
flush();
}
?>


Waiting for replies....

No comments posted yet

Your Answer:

Login to answer
255 Like 10 Dislike
Previous forums Next forums
Other forums

Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...

Code: $define_li

database design
Hi,

I got a page which allow candidate to type in their previous working experience,
I let

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I

Add trigger to UpdatePanel programmatically
Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel whi

turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

Help with translating C code into assembler code
Hi im doing a project that moves a robot around a maze avoiding walls and need some help with conver

Click counter to ignore traffic from search bots
I have a click counter on my site that...well, counts the number of clicks a link gets on the frontp

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash