http referer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
davelr459
Forum Newbie
Posts: 1
Joined: Tue Oct 09, 2007 7:43 pm

http referer

Post by davelr459 »

I am trying to use the http referer variable from a secure page with php 4.4 , is this possible? I cant seem to get it to work...

Is there an alternative to http referer? I just need to know what url the user was on before coming to the web page. Thanks
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: http referer

Post by Zoxive »

davelr459 wrote:I am trying to use the http referer variable from a secure page with php 4.4 , is this possible? I cant seem to get it to work...

Is there an alternative to http referer? I just need to know what url the user was on before coming to the web page. Thanks
Store it as a Session, or maybe even a Get Variable.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

$_SERVER['HTTP_REFERER'] is not guaranteed to be set. NEVER rely on that being set. Sessions are probably your best bet.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

If the end user is coming from a remote web site, then HTTP_REFERER may or may not be set, and may or may not be accurate.

It's a good tool, for guessing with some accuracy.

If you're doing this all in the same local web site, storing the URI/path info/query strings etc in a session variable would be perfect.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply