Hello, I was wonder if it's possible to retrieve from the current url the url in which the guest was referred by. At the moment, whenever I try including my PHP file that checks for the referring url, it keeps checking itself instead of checking the page in which I included it on with php. Here's the code that I'm trying to use: code.php <?php echo 'document.write("'.$_SERVER['HTTP_REFERER'].'")'; ?> Code (markup): referer.html <script language="javascript" src="code.php"></script> Code (markup): When you go to referer.html, it's showing "referer.html" instead of showing the referral url to referer.html. Thanks for the help in advanced.
you want to find the referrer page? <script>document.write('<img src="hidden.php?ref=' + document.referrer + '" style="display:none;">'); Code (markup): hidden.php $ref = $_REQUEST['ref']; echo $ref; PHP: is this what you want?
For some reason, it's still not allowing me to track search engine referrals. All that document.referrer records is up to "&hl=en". For example, if I searched for the word "test" on Google, the script would only pick up "http://www.google.com/search?hl=en". Is there a way to fix this?
Try this, not sure if it will work though: <script>document.write('<img src="hidden.php?ref=' + escape(document.referrer) + '" style="display:none;">'); HTML: