Setting a redirect 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
dotancohen
Forum Newbie
Posts: 11
Joined: Thu Aug 04, 2005 5:37 am
Location: Haifa
Contact:

Setting a redirect referer

Post by dotancohen »

Hi all,
On http://lyricslist.com I link to another website with <a href=''>. They read $HTTP_REFERER and give me one point for each click. So far so good.

I want to know how many people are clicking on the link. So I created a goto.php file, that records the click and send the visitor on her way with a redirect:

Code: Select all

$url=" http://song-lirics.com ";  // $url is set before header()
header("Location: $url");
This works great, but the variable $HTTP_REFERER is not set at the other site! So they don't know that the hit came from me! I also tried using the meta tag redirect, but that didn't work either.

I tried this in FireFox 1.0.6 and in Opera 8. Please, if anyone could shed any light on the subject, I would appreciate it. Thanks!

Dotan Cohen
http://IE-only.com
Revan
Forum Commoner
Posts: 83
Joined: Fri Jul 02, 2004 12:37 am
Location: New Mexico, USA
Contact:

Post by Revan »

header('Referer: http://www.yoursite.com');
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the referer information is sent by choice of the browser. You don't have control over it.

If you returned a meta tag redirection page it may help solve it though.
dotancohen
Forum Newbie
Posts: 11
Joined: Thu Aug 04, 2005 5:37 am
Location: Haifa
Contact:

Post by dotancohen »

I see that I don't have control over it. I do have a site that links to me, via a out.php page on their site. And the $HTTP_REFERER variable is certainly set when the user gets to my page. I can post a link if anybody wants to try it for themselves. How on earth are they doing that?
Post Reply