Re: Script executing Telnet Shell Command...

From: Date: Mon, 22 Jul 2002 23:27:34 +0000
Subject: Re: Script executing Telnet Shell Command...
Groups: php.general 
Request: Send a blank email to php-general+get-108977@lists.php.net to get a copy of this message
>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

« previous php.general (#108977) next »