Jump to content

TELNET TO pragma telnet server through php


dm123

Recommended Posts

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 :facewall:

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.