Forum Moderators: coopster
I have written a script which will connect to a remote page then submit form data to that file and after that it will get the response.
Here is a code snippet of http response code
while(!feof($fp))
{
$http_response.=fgets($fp,1024);
}
echo "The server response is<br>";
$response = htmlspecialchars($http_response);
echo nl2br($response);
fclose($fp);
The output it gives from the response is something like this
The server response is
HTTP/1.1 200 OK
Date: Sun, 19 Mar 2006 00:52:11 GMT
Server: Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.1 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a
X-Powered-By: PHP/4.4.1
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html6f
<html>
<head>
<title>
</title>
</head>
<body>
This is Test<br>
Webmaster Suman Haldar
</body>
</html>
0
but actually test.php should return this
The server response is
HTTP/1.1 200 OK
Date: Sun, 19 Mar 2006 00:52:11 GMT
Server: Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.1 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a
X-Powered-By: PHP/4.4.1
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
<html>
<head>
<title>
</title>
</head>
<body>
This is Test<br>
Webmaster Suman Haldar
</body>
</html>
I checked the response of test.php using a HTTP Sniffer httplook. And the Response is like the below one.
Then why do I get this 6f at first of the HTTP Response and 0 at the last of the HTTP response.
I wish some Guru can help me on understanding the HTTP response i m getting using the Code mentioned here. what are those? If there is any reference available that will be gr8 for me .
Thanks in advance.
[edited by: coopster at 1:36 pm (utc) on Mar. 19, 2006]
[edit reason] closed the quotation [/edit]