HTTP_REFERER nothing there?
Posted by Chris_Isaac (Chris Isaac), 14 May 2006I'm trying to use the above predefined varible, but it's not there??
I've looked in the phpinfo() page, but its not listed, does it exist anymore?
I can get SERVER_NAME, and others like that, but not HTTP_REFERER.
What I'm trying to do is look at the referer page and if its from page X then it will display X's title, if it from page Y then it will display Y's title, is there another way of doing it apart from HTTP_REFERER?
Posted by admin (Graham Ellis), 14 May 2006No, not gone away for good ... but I think I know what may have happened to you. The $_SERVER[HTTP_REFERER] variable is only set if there is a referer in the http headers - i.e. if the page is called up via a link. If you go to your phpinfo page by typing in its URL, you won't see it.
By the way - you might do better to have each page pass on its referer reference via a hidden field rather than by using the referer, as it's quite easy on some browsers to tell them NOT to sent the referer. Users of such browsers will find your site broken as far at they're concerned if you rely on the referer.
Posted by Chris_Isaac (Chris Isaac), 14 May 2006It was called via a form submit button (the form I was having trouble with on the last problem I had). The form originated from 1 domain then went to another so I assumed it would show in HTTP_REFERER.
I'll try adding it as a hidden field.
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho