$HTTP_REFERER problem :(

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
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

$HTTP_REFERER problem :(

Post by qads »

hi,
i use a URL redirecting service for my site, so when i use $HTTP_REFERER to find where the user came from i get my own redirecting url, how i can i get the real address of the site which the user came from?

thanks alot in adv.
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

Unless your referrer will agree to start POSTing the original referring site, I can't think of a way to get their original referrer. At the least, it's not a default PHP constant.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

As llimllib said, there's really no way to do it without the cooperation of the people redirecting your site traffic. You can only grab the $HTTP_REFERER for the site/page immediately before the current page. Unless someone has a clever solution, I think you're stuck.

Mac
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

:(
ok.....hmmmm how about tring to do it with java script?

normaly you can do

Code: Select all

window.history.back(1)
(something like that)

would

Code: Select all

window.history.back(2)
work?
i would try it but i dont know ho wto get it in to php :x
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

sorry to say it, but I still don't think you can. I don't see a way to get a string containing the history at the mozilla man page for window.history.
I tried to do it for a few minutes, but i was unable - hopefully you'll have more luck.
Post Reply