dm123 Posted July 13, 2011 Share Posted July 13, 2011 i want to telnet to a server and login,then to run several commands. i got script and modified it ,it seems to work on other machines(i tried on my router) but not on my remote pragma telnet server.Please help !! <?php // $user=$_POST['textfield']; // $pass=$_POST['textfield2']; $Server ='10.0.64.23'; $Port = 23; $TimeOut = 10; $errno=0; $errstr=""; $usenet = fsockopen($Server, $Port, $errno, $errstr, $TimeOut); if(!$usenet) { echo "Connection failed\n"; exit(); } else { ////////want ot read just starting 4 lines for testing/////////// $i=0; $data; while($i<=4) { $i++; $data = fgetcsv($usenet, 1000, "\n"); } $num = count($data); for ($c=0; $c < $num; $c++) { echo $data[$c]; } } ?> as soon as i run the script fgetscv goes infinite and maximum time of execution error occurs; please help Quote Link to comment https://forums.phpfreaks.com/topic/241878-telnet-to-pragma-telnet-server-through-php/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.