You can however check how you arrived at the current page by using 2 methods:
document.referrer
, but that only works if the user didn't block that, and gives you some limited info.
A more robust method might be to set some information about the previous page in either the URL, or in a SESSION
variable.