Click to See Complete Forum and Search --> : Clearing HTTP_REFERER value?


ziffgone
05-20-2004, 07:40 PM
Hi, is there a way that I can clear the HTTP_REFERER value before redirecting to another page?

I have a situation where I want all of the paying members from my friend's website to receive a 30% discount on the product I'm selling. I currently have a redirect script that uses HTTP_REFERER to redirect traffic from his site to the discount page.

Problem is, he has a link for his free members as well who aren't privy to this discount. The script I'm using sends them to the discount page anyway as the HTTP_REFERER is still set as his site. He currently uses a ClickBank hoplink to link to my site as I want him to receive a commission on all sales sent my way, both discounted or full sale, therefore I can't give him a separate link for the full price sales or he won't receive a commission.

I tried to rectify the situation by giving him a link to a script that redirects using his ClickBank hoplink from my server, I thought this would reset the referring site to my own and send the viewer to my home page instead of the discount page. No luck.

If I can clear or set the HTTP_REFERER value before redirection, this would be the best solution I can figure. Can this be done?

Regards...

this213
05-21-2004, 02:38 PM
$ENV{HTTP_REFERER} = '';

That will clear HTTP_REFERER if it's done on the target system (After the "real" HTTP_REFERER has already been parsed). As far as I know, that value gets reset each time you transmit, so resetting this will not change what gets reported to the next system in line.

However, if these links are coming from different pages on the "from" server, you can evaluate HTTP_REFERER and decide what to do based on which page it's coming from.

Other than that, you might set up another link through Clickbank (I'm not familiar with them, so I'm not sure how they work) thus giving you 2 separate links to work with.

Another consideration - depending on how much sway you have with the referer, would be to use a common cookie and decide what to do based on the status of that.

hth
This