What page did the user come from?

If you wish to know what page was the previous page the visitor visited prior to this page you can use:

I’m using this in forms and I simply add the value of “$urlbefore” to a hidden field.
The code above also makes sure that submitting the form does not change the url since it is reassigned to its previous value, if exists.

Leave a Reply

Your email address will not be published. Required fields are marked *