Hi all Does anyone possibly know how i can effeciently get the referrer in php. The script i have seems to only work occasionaly. I need something that will say to the user hello... you came from x.com/pagex/something.html to go back to x.com click here. Thanks
dont know what you are already using but try this to get the previous url and store it in variable or in href to move back $backurl=$_SERVER['HTTP_REFERER'];
thanks bug coder...heres what ive got: <? $referer = $_SERVER['HTTP_REFERER']; $refererhome = $_SERVER['HTTP_HOST']; ?> you came from:<?echo "$referer"; ?> return to the homepage of the site you came from please click here : <a href="http://<?echo "$refererhome"; ?> ">click here</a> It doesnt seem to work though?
If a user came from a site wich opened your site in a new tab/window the referer is empty, otherwise the code above should work!
thats what i thought. At the momemt im using it from a 404 (so 404 redirects from one site to another with script) That shouldnt make any difference should it. And its not in a new window or anythingm its just a straight redirect. So that should work you think? Thanks for your helpby the way