>I am trying to execute a Script running a telnet command
>testing through a range of IP connections...
>Here goes:
>
><?
>    $str = "123.456.789.";
>    $count = 0;
>
>    while ($count < 999){
>        $runTheScriptCommand...
>    }
>?>
>
>What I want to stick into the while loop is if connection
>was successful, break...  Is there a way I can check whether
>telnet connection was successful on each step through the
>loop or do I have to restructure my program and try
>connecting to a port via fsockopen...  By the way
>does anyone know what port number telnet connects to...

You should be able to capture the output of http://php.net/exec or
http://php.net/popen and do whatever you want with it.

fsockopen will, however, almost certainly be faster/better if you have to do
a lot of these.

I think telnet is port 22, usually...  Or maybe 23.  SSH is the other one of
those, and I always forget.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to