telnet problem with PHP
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

telnet problem with PHP

From: _andrea.l <andrea.lorizANTISPAM@libero.it>
Date: Thu Dec 22 2005 - 23:50:22 CET

I'm writing a little script for reading information from a router by telnet.
I have a problem

How give a comand and get the answer more times?
I means:

[...]
 $usenet = fsockopen($cfgServer, $cfgPort, &$errno, &$errstr, $cfgTimeOut);
[...]
 fwrite ($usenet, "show interface description\r\n\n");
[...]
while (!feof($usenet))
{
$r1=fgets($usenet, 1000)."<BR>\n";
}

The program don't exit from while...
... because the telnet don't give feof.
Hoh can I do?

Thank you in advance,
Andrea.
Received on Fri Dec 23 20:17:48 2005