Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
HTTP_REFERER nothing there?

Posted by Chris_Isaac (Chris Isaac), 14 May 2006
I'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?

Thanks.

Posted by admin (Graham Ellis), 14 May 2006
No, 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 2006
It 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.

Thanks again.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho