The following code generated garbase output. what is wrong ?? 

<?php
  $sp = fsockopen("localhost", 23);
  if(!$sp){
    echo "error";
    exit;
  }
  socket_set_blocking($sp, FALSE);

  function getLine(){
    global $sp;

    $op = fgets($sp, 1024);
    while(empty($op)){
      $op = fgets($sp, 1024);
    }
    return $op;
  }

  echo getLine();
?>

The output was as follows:

[root@ispms html]# php telnet.php
X-Powered-By: PHP/4.1.0
Content-type: text/html

ÿý▒ÿý ÿý#ÿý'[root@ispms html]#


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to