I know that fsockopen issues have been beaten to death on this forums...but I am still having a small problem implementing what I want to do. I am sending a POST with 1 key=value segment. It seems to me that I should display the page specified in the url (which in this case simply shows the POSTed data).
Here's my fsockopen..... code>>>
#--------------------------------
$url = '/test_post.php3';
$fp = fsockopen ('www.THESITE.com', 80, $errno, $errstr);
if ($fp) {
fputs ($fp, "POST $url HTTP/1.0\r\n");
fputs ($fp, "Accept: */*\r\n");
fputs ($fp, "Accept-Language: en\r\n");
fputs ($fp, "Connection: Keep-Alive\r\n");
fputs ($fp, "Content-type: application/x-www-form-urlencoded\r\n");
$out = "";
$out = 'name=Hello';
fputs ($fp, "Content-length: ".strlen($out)."\r\n\r\n");
fputs ($fp, $out."\r\n");
fclose ($fp);
}
I did have error checking (which showed the socket opened, etc.) but have removed all but the barest minimum of the code at this point.
If I send this same request from an actual form with a submit button my "send to" page works fine....this, however, still shows the same url in the address of the browser.
Waht am I misunderstanding that prevents the "send to" page from displaying?
I appreciate any help!
Thanks,
Jeff