Get Referrer

Reply

Join Date: Feb 2008
Posts: 6
Reputation: vaibhavs is an unknown quantity at this point 
Solved Threads: 0
vaibhavs vaibhavs is offline Offline
Newbie Poster

Get Referrer

 
1
  #1
Feb 21st, 2008
Hi,

I have a PHP Script. I need the referrer website address for this script.

I used the following 2 commands:
getenv('HTTP_REFERER');
$_SERVER["HTTP_REFERER"]

I believe both are the same.

But in majority of the cases I am unable to get any values using the above 2 variables.

I would not believe that 90% of the worlds browsers have javascript disabled.
Correct me if I am wrong.

Is there any 100% sure method of getting referrer ??

Thx
Vai
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 158
Reputation: richie513 is an unknown quantity at this point 
Solved Threads: 11
richie513's Avatar
richie513 richie513 is offline Offline
Junior Poster

Re: Get Referrer

 
0
  #2
Feb 21st, 2008
Hi Vai,

Usually PHP will make the referrer automatically available in the variable, Have you had a look to see if these variables are available using phpinfo?
Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important.
richie513
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 600
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 126
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Practically a Master Poster

Re: Get Referrer

 
0
  #3
Feb 21st, 2008
These variables will be empty if someone
A.)gets to your site via a link with a target="_blank".
B.)types the url directly into the browser
C.)Came from a bookmark or favorite
D.)Right clicked to open your link in a new tab/window
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,833
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 344
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Get Referrer

 
0
  #4
Feb 21st, 2008
A.)gets to your site via a link with a target="_blank".
D.)Right clicked to open your link in a new tab/window
I just tested it and it works.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 6
Reputation: vaibhavs is an unknown quantity at this point 
Solved Threads: 0
vaibhavs vaibhavs is offline Offline
Newbie Poster

Re: Get Referrer

 
0
  #5
Feb 22nd, 2008
The code is working fine.
I get the value of referer, but for only a small % of hits.

Hence I was wondering if there are situations which are not captured by this PHP command.
OR if I need anyother command.

This is being done for evaluating hits from search engines.

Thx
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 3540 | Replies: 4
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC