Hello,
When I do a POST request with fsockopen and print the output to the screen, the following text is always added automatically:
HTTP/1.1 200 OK
Date: Sun, 17 Dec 2000 16:39:43 GMT
Server: Apache/1.3.4 (Unix) FrontPage/4.0.4.3
X-Powered-By: PHP/4.0.3pl1
Connection: close
Content-Type: text/html
-->The actual content begins here<--
Is there any way to suppress the output of these headers?
The code I use is:
$request = "var=test";
$header = "POST /test2.php HTTP/1.0\r\n";
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$header .= "Content-length: " . strlen($request) . "\r\n\r\n";
$fp = fsockopen('www.myserver.com', 80, &$err_num, &$err_msg, 30));
fputs($fp, "$header . $request");
while (!feof($fp)) echo fgets($fp, 128);