fsockopen

From: Date: Fri, 25 Jan 2002 00:31:58 +0000
Subject: fsockopen
Groups: php.general 
Request: Send a blank email to php-general+get-82018@lists.php.net to get a copy of this message
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

« previous php.general (#82018) next »