Getting header information from remote server
Moderator: General Moderators
Getting header information from remote server
I could only find a tool to get me the code response (which was 302), but I'd like to know exactly where the URL somethingsomething is referring me to. How do I find this information? If someone knows of a PHP script to do this, that's great, but an online tool, such as http://urlencode.de/ would be even better.
Last edited by nutkenz on Tue Nov 28, 2006 4:02 pm, edited 1 time in total.
I probably misunderstand you.. In case you recieve a 302 status code you also recieve a header with key: "Location" that contains he URI...
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.
The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
You could simply make it... it's not all that difficult.
If you have a new enough version of PHP, it even has the function for you: get_headers()
If you have a new enough version of PHP, it even has the function for you: get_headers()