Ok, fixed the problem.
Just in case this happens to someone else, here's the answer to my original
delimma.
Web servers are very particular about the number of line feeds and carriage
returns that follow headers. Some need "\r\n" and others "\r\n\r\n". Also,
you need to include a host header to make HTTP 1.1 servers happy. 1.0
servers don't require this and will ignore it.
"Han" <nobody@nowhere.com> wrote in message
news:KQ6fb.672961$uu5.110283@sccrnsc04...[color=blue]
> Ok, it seems the problem is related to the HTTP version. 1.0 works great,
> but 1.1 complains about a missing host header. I added a host, but I still
> get the same message.
>
> "Han" <nobody@nowhere.com> wrote in message
> news:dt4fb.392550$2x.131421@rwcrnsc52.ops.asp.att. net...[color=green]
> > Ok, I think part of the problem is that my function is being called from
> > within a frame. The path and host references are wrong. I might have to
> > reconsider where the request originates...
> >
> > "Han" <nobody@nowhere.com> wrote in message
> > news:dy0fb.483273$cF.168086@rwcrnsc53...[color=darkred]
> > > The following function retreives a GET request. It works great with[/color][/color][/color]
many[color=blue][color=green][color=darkred]
> > > sites (exp.
www.msn.com), but others just hang (exp.
www.ebay.com) or[/color]
> > return[color=darkred]
> > > an error (exp.
www.microsoft.com).
> > >
> > > I've tried adding additional headers like "Referer" and "Accept", but[/color][/color][/color]
it[color=blue][color=green][color=darkred]
> > > doesn't make a difference.
> > >
> > > What needs to be done to satisfy those web servers that won't[/color][/color][/color]
cooperate?[color=blue][color=green][color=darkred]
> > >
> > > Thanks.
> > >[/color]
> >[/color]
>
> --------------------------------------------------------------------------[color=green]
> > --[color=darkred]
> > > -
> > >
> > > $link = "http://www.domain.com?param1=string";
> > >
> > > $http_response = "";
> > > $url = parse_url($link);
> > > $fp = fsockopen($url[host], 80, $err_num, $err_msg, 30) or[/color]
> > die("Socket-open[color=darkred]
> > > failed--error: ".$err_num." ".$err_msg);
> > > fputs($fp, "GET /$url[path]?$url[query] HTTP/1.0\n");
> > > fputs($fp, "Connection: close\n\n");
> > > while(!feof($fp)) {
> > > $http_response .= fgets($fp, 128);
> > > }
> > > fclose($fp);
> > > echo $http_response;
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]