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.
detect last url visited
Moderator: General Moderators
- speedy33417
- Forum Contributor
- Posts: 128
- Joined: Sun Jul 23, 2006 1:14 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
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
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
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
Table footprints
Code: Select all
ID PAGE SESSION_ID
1 4 bleh
2 6 bleh
3 3 bleh2== unreliableThe Ninja Space Goat wrote:$_SERVER['HTTP_REFERER']
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
Last edited by John Cartwright on Tue Oct 31, 2006 4:30 pm, edited 1 time in total.
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?Jcart wrote:== unreliableThe Ninja Space Goat wrote:$_SERVER['HTTP_REFERER']
HTTP_REFERER is an optional value, of which the browser can easily disable.
Here is a nice hack that tries to figure out where you've been: http://jeremiahgrossman.blogspot.com/20 ... -been.html.