Online I am making, I must understand how a person arrived on the particular page (say here.php). There might be two good ways: by clicking the hyperlink on page1.php or even the link on page2.php. How do i discover the way the user arrived at, to ensure that I'm able to provide content based on that.


[cde] DOCs should provide you with page the consumer has showed up from:

The address from the page (if any) which known the consumer agent towards the current page. This really is set through the user agent. Not every user agents will set this, plus some provide a chance to modify HTTP_REFERER like a feature. In a nutshell, it can't be reliable.

Utilizing a session

If you wish to track a customers progress using your site then it might be simpler/far better to set a session ([cde] DOCs) and employ that to trace them because they land in your pages.

Training regimen a snipped of code in for instance the footer of every page in which you save the refferring page( $_SERVER['HTTP_REFERER'] ), but the current page. If you are using the Session_id like a unique identifier for that customer you're then capable of seeing a brief history of every customer.