I'm having trouble making a GET request using fsockopen.  I'm using the sample code from the www.php.net website (the first example on fsockopen's function page).  I get this error:

no socket: (0)

Here's the code I'm using:

<?php
$domain = "ww4.mrgres.com";

$fp = fsockopen($domain, 80, $errno, $errstr, 30);

if (!$fp) {
        echo "no socket: $errstr ($errno)<br>\n";
} else {
        fputs ($fp, "GET /resnet/LANSAWEB?procfun+roweb+roweb04+bay+funcparms+UP(A2560):;winterwon/qp;?HTTP/1.0\r\nHost:$domain\r\n\r\n");

        while (!feof($fp)) {

                $return .= fgets ($fp,1280);
        }
        fclose ($fp);
}
print $return;
?>

Any help would be appreciated.

Thanks,
Andy

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