Mantis - Quercus
Viewing Issue Advanced Details
834 minor always 01-06-06 12:38 05-19-06 13:07
creich  
ferg  
normal  
closed  
fixed  
none    
none 3.0.20  
0000834: fsockopen
The following script returns an empty $errno and $errstr.

It should work (even if you change the url to "127.0.0.1").


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> [^]
<html xmlns="http://www.w3.org/1999/xhtml"> [^]
<head></head>
<body>
<?php
$fp = fsockopen("www.yahoo.com", 80, $errno, $errstr, 30);
if (!$fp) {
   echo "$errstr ($errno)
\n";
} else {
   $out = "GET / HTTP/1.1\r\n";
   $out .= "Host: www.example.com\r\n";
   $out .= "Connection: Close\r\n\r\n";

   fwrite($fp, $out);
   while (!feof($fp)) {
       echo fgets($fp, 128);
   }
   fclose($fp);
}?>
</body>
</html>

There are no notes attached to this issue.