Using PHP is it possible to detect a visiting URL? I would like to add some code to my index.php script that could tell me where my visitiors are coming from (which URLs). Can this information be captured somehow with PHP?
Thanks...
Using PHP is it possible to detect a visiting URL? I would like to add some code to my index.php script that could tell me where my visitiors are coming from (which URLs). Can this information be captured somehow with PHP?
Thanks...
pr0gr4mm3r posted this at 17:56 — 6th July 2007.
He has: 855 posts
Joined: Sep 2006
Yup, it's in the $_SESSION['HTTP_REFERER'] variable.
PHP Starter - PHP Tips & Tools From Starters to Experts
frank727 posted this at 18:26 — 6th July 2007.
They have: 12 posts
Joined: Jun 2007
I get a blank when I use this code snippet on my home page:
$ref = $_SESSION['HTTP_REFERER'];
print $ref;
brady.k posted this at 18:29 — 6th July 2007.
He has: 1,383 posts
Joined: Feb 2002
not $_SESSION['HTTP_REFERER'], but rather:
<?php$_SERVER['HTTP_REFERER'];
?>
That will do the trick.
Kyle Brady, President, Intuitive Industries LLC.
http://www.int-ind.com
[EMAIL=brady.k@gmail.com]brady.k@gmail.com[/EMAIL] - [EMAIL=brady.kyle@int-ind.com]brady.kyle@int-ind.com[/EMAIL]
pr0gr4mm3r posted this at 18:31 — 6th July 2007.
He has: 855 posts
Joined: Sep 2006
Woops. That's what I meant.
PHP Starter - PHP Tips & Tools From Starters to Experts
brady.k posted this at 18:37 — 6th July 2007.
He has: 1,383 posts
Joined: Feb 2002
No worries... hahah