Re: Getting full HTTP request the page was requested with?
| From: | Leif K-Brooks | Date: | Sun, 15 Dec 2002 17:55:30 +0000 |
| Subject: | Re: Getting full HTTP request the page was requested with? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128335@lists.php.net to get a copy of this message | ||
Thanks, but I'm trying to see what the client sent to get my page, not what a host returns when I send it a request...
Hatem Ben wrote:
$url = "http://myserver.com"; $sockhandle = @fsockopen($url, 80, &$errno, &$errstr); if(!$sockhandle) { $mes = "server $url not available!"; $result = "<center><h5>$mes</h5></center>"; return $result; } else { $request = "GET / HTTP/1.1\r\n"; $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n"; $request .= "Host: $url\r\n"; $request .= "Connection: Close\r\n\r\n"; fputs($sockhandle, $request); $res = ""; $line = fgets($sockhandle, 1024); //Request Method $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Close Method $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Server Type $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Date $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Transfer-Encoding $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Content-Type $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Cache-control $res .= "$line\n"; $line = fgets($sockhandle, 1024); //Set-Cookie $res .= "$line\n"; $line = fgets($sockhandle, 1024); //End Header "space" $res .= "$line\n"; $res = addslashes($res); return $res; ----- Original Message ----- From: "Leif K-Brooks" <eurleif@buyer-brokerage.com> To: <php-general@lists.php.net> Sent: Sunday, December 15, 2002 4:54 PM Subject: [PHP] Getting full HTTP request the page was requested with?-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.Is there a way to find out exactly what HTTP request was made for a page? Something like: GET http://myserver.com/whatever.php HTTP/1.1 Host: myserver.com -- The above message is encrypted with double rot13 encoding. Anyunauthorized attempt to decrypt it will be prosecuted to the full extent of the law.-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php