Click to See Complete Forum and Search --> : Http_referer


Winglys
03-27-2003, 09:02 AM
Can someone explain to me how HTTP_REFERER work?
What kind of data will store in this environment variable and how the structure of the data?
For example in CONTENT_LENGTH, the data from html page will be stored as below
name=.......&email=.........
where ......... is the keyword that user key in in html page.
So I wish to know the same format for HTTP_REFERER.
thanks

DaiWelsh
03-28-2003, 04:04 AM
HTTP_REFERER will contain the page that the browser claims it last visited. For example if a browser opens http://www.domain1.com/page1.html and follows a link on this page to http://www.domain2.com/page2.html then the call to page2 would usually pass http://www.domain1.com/page1.html as the referer.

Note however, that this is just what the browser tells the server it has just been to, it cannot be relied on for security or even very reliable functionality sometimes.

Additionally, if the browser has come to a page because of a javascript call or via a bookmark or by typing the url into the browser bar or....then the referer will usually be blank.

In summary, referer can be very useful for seeing which other sites have links to your sites and what route people tend to use within your site, but ideally should not be relied on for anything more concrete.

HTH,

Dai