Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php how to find the location where a user came from?

Tags:

php

location

simple question:

how to find the location (url) where a user came from before accessing my page?

and

how to find the location (url) where a user goes after exiting my webpage?

any ideas where i should start? thanks

like image 879
Patrioticcow Avatar asked Jul 22 '11 19:07

Patrioticcow


1 Answers

In PHP, you can use the $_SERVER['HTTP_REFERER'] to know where the user came from.

There is no mechanism to know where the user is going, unless they clicked a link on your site to leave your page. (If that is the kind of exit that you want to track, you'll need to rely on javascript and implement something like Google Analytics outbound link tracking: http://www.google.com/support/analytics/bin/answer.py?answer=55527)

like image 150
Eric Caron Avatar answered Sep 22 '22 12:09

Eric Caron