I'm trying to post some infomrmation to a web page using fsockopen(). It looks to be working correctly, but I don't get any of the HTML that the page is supposed to display after my post has been processed. I only get the header.
Here is my code:
// Build the header
$header = "POST ".$url["path"]." HTTP/1.0\n";
$header .= "Content-type: application/x-www-form-urlencoded\n";
$header .= "Content-length: " . strlen($request) . "\n\n";
// Open the connection
$fp = fsockopen($url["host"], 80, $err_num, $err_msg);
if ($fp) {
fputs($fp, $header.$request);
while (!feof($fp)) {
$response .= fgets($fp, 4096);
}
}
And here is what I get in the $response variable when all is finished:
HTTP/1.1 200 OK Date: Tue, 26 Dec 2000 21:04:51 GMT Server: Apache/1.3.12 (Unix) (Red Hat/Linux) PHP/4.0.3pl1 X-Powered-By: PHP/4.0.3pl1 Connection: close Content-Type: text/html
Which leads me to believe that the post is working, but my script that I'm posting to is supposed to return some HTML for me to process. Is there something that I'm missing?