Page 1 of 1

detect last url visited

Posted: Tue Oct 31, 2006 4:10 pm
by speedy33417
How do I detect where the user is coming to my page?

I'd like to create a custom statistics page for myself, to track traffic on my site. I have no problem once the user is on my site and moving between pages, but I'm not sure how to grab that info if they arrive from an outside page.

Thanks.

Posted: Tue Oct 31, 2006 4:21 pm
by Luke

Posted: Tue Oct 31, 2006 4:24 pm
by John Cartwright
The best way is to have your pages interact with the database, as in each page request is recorded by the requested page. Tied in with their session_id you can track their movements.

Table footprints

Code: Select all

ID   PAGE   SESSION_ID
1    4      bleh
2    6      bleh
3    3      bleh2
This is best accomplished with a front controller, where all the actions are routed through a single request. This way, you can intercept the requested page, make notes of it (time, session_id, page request) and then load the page
The Ninja Space Goat wrote:$_SERVER['HTTP_REFERER']
== unreliable

HTTP_REFERER is an optional value, of which the browser can easily disable.


EDIT| sorry I didn't properly read your question, might as well ignore me :D

Posted: Tue Oct 31, 2006 4:28 pm
by Luke
Jcart wrote:
The Ninja Space Goat wrote:$_SERVER['HTTP_REFERER']
== unreliable
HTTP_REFERER is an optional value, of which the browser can easily disable.
I know this... but isn't it the only way to get the referer? I know you can track where they are going within YOUR site... but what about where they came from?

Posted: Wed Nov 01, 2006 12:50 am
by aaronhall
I think that's it...

Posted: Wed Nov 01, 2006 3:58 am
by timvw
Here is a nice hack that tries to figure out where you've been: http://jeremiahgrossman.blogspot.com/20 ... -been.html.