View Full Version : HELP PLEASE: Finding Page REFERER
yaunus
02-04-2003, 02:29 PM
I have some banner ads up on various sites across the web. These ads all lead to a form which the user then fills out. How can I use PHP to track where they came from? Or maybe there is a way without PHP. Either way, any awsers would be great!
Thanks!
Ian
scoutt
02-04-2003, 07:59 PM
<?
echo $_SERVER['HTTP_REFERER'];
?>
that will tell you where they came from in php.
yaunus
02-05-2003, 01:41 PM
Hm....
I put that in, and it doesn't display anything. I tried putting quotes around it, but then i got some different error.
Any idea what I'm doing wrong?
scoutt
02-05-2003, 02:20 PM
how did you put it in? if has to be in a page where you want to detect the referer, just loading it in a page will do nothing. what is th code you have?
yaunus
02-05-2003, 02:27 PM
The link is:
[url]http://www.novembertrials.com/php/php[url]
yaunus
02-05-2003, 02:28 PM
http://www.novembertrials.com/php.php <--correct link
scoutt
02-05-2003, 02:30 PM
I need the code, with that you can't see the code.
yaunus
02-05-2003, 03:40 PM
Oops.
Well, all I did was paste the code you gave me and saved it as a php file. What I'm trying to do is create a hidden field that will have the PAGE REFERER as the data.
THANKS! Ian
scoutt
02-05-2003, 03:47 PM
then just place the above code in the form as ahidden variable. but befroe that, what version of php do you have?
yaunus
02-05-2003, 04:58 PM
How do I find out what version I have?
By the way, do you happen to have AIM?
scoutt
02-05-2003, 05:01 PM
just load this in a page an dupload it to your server and then run it
<?
phpinfo();
?>
that is it.
and now I don't have AIM, MSN, ICQ, or Yahoo
yaunus
02-05-2003, 05:46 PM
Version 4.1.2.
When I use the code you gave me, nothing shows up, just blankness.
scoutt
02-05-2003, 05:52 PM
you did it just like that? and you left it in caps? it has to be in caps. if that is all you had then it should have worked.
try this way
<?php
echo $_SERVER["HTTP_REFERER"];
?>
yaunus
02-05-2003, 06:11 PM
Thanks so much!
It's working now.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.