Jump to content

Go Back Page Link


utkesmer

Recommended Posts

you can do it with javascript, if I'm correct. It involves using the browsers history (part of the DOM?) to determine where they've been.

Link to comment
Share on other sites

You could also do it with PHP by storing the last page you were on in a session variable and linking to that value/<a href="<?php echo $_SESSION["last-page"]; ?>">Go back</a>I like this approach because it works even if JavaScript is not enabled.

Link to comment
Share on other sites

You could also do it with PHP by storing the last page you were on in a session variable and linking to that value/<a href="<?php echo $_SESSION["last-page"]; ?>">Go back</a>I like this approach because it works even if JavaScript is not enabled.
Using the HTTP_REFERER header is probably better. That way it would work even if you got to the page through somewhere else.
<a href="<?php echo $_SERVER['HTTP_REFERER']; ?>">Go back</a>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...