Friday, January 4, 2013

How to return a page before current

To create a link "Back" that allow come back to previous page before current, I use a variable called $_SERVER['HTTP_REFERER']. Hereafter, you will see a example:

...
<body>
  ...
  <a href="<?php echo $_SERVER['HTTP_REFERER']?>">Back</a>
  ...
</body>
...

Be careful when you refresh the page!

No comments:

Post a Comment