Page 1 of 1
Getting header information from remote server
Posted: Tue Nov 28, 2006 9:55 am
by nutkenz
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.
Posted: Tue Nov 28, 2006 10:37 am
by timvw
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
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.
Posted: Tue Nov 28, 2006 10:45 am
by nutkenz
Well, the tool I used only showed the code unfortunately...
Posted: Tue Nov 28, 2006 1:04 pm
by timvw
Then it's time to read the manual of your tool.. Or get a tool that does what you want it to do.
Posted: Tue Nov 28, 2006 1:44 pm
by nutkenz
Well, that's why I'm here. In case someone knows of a tool that does show the location as well...
Posted: Tue Nov 28, 2006 3:57 pm
by feyd
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()
Posted: Tue Nov 28, 2006 4:05 pm
by nutkenz
True, done.