|  | Posted by Rik on 01/30/07 11:50 
Aetherweb <jeffsnox@gmail.com> wrote:
 > Hi,
 >
 > I need to use fsockopen to open a connection, send a GET request and
 > read in the response. At the moment I'm trying the following code, but=
 
 > I think it's ignoring the actual URL included in the $request
 > variable.
 >
 > $host    =3D "www.myhost.com";
 > $request =3D "/myurl.php?param1=3D1¶m2=3D2¶m3=3D3";
 >
 > $fp =3D fsockopen($host, 80, $errno, $errstr, 3.0);
 >
 > if ($fp)
 > {
 > 	# Send the get request then, with timeout...
 >     fwrite($fp, "GET / HTTP/1.0\r\n" .
 
 "GET $request HTTP/1.0\r\n" .
 
 -- =
 
 Rik Wasmus
  Navigation: [Reply to this message] |