utkesmer Posted July 21, 2009 Share Posted July 21, 2009 I am trying to make a link which you will go to back page when you clicked on it. Is there a link like this?Exp., maybe like this. --> <a href="_back">Go Back.</a> Link to comment Share on other sites More sharing options...
thescientist Posted July 21, 2009 Share Posted July 21, 2009 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 More sharing options...
utkesmer Posted July 21, 2009 Author Share Posted July 21, 2009 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.Hımmm we can do with javascript but can not with html... Ok, thanks. Link to comment Share on other sites More sharing options...
sckewi Posted July 21, 2009 Share Posted July 21, 2009 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 More sharing options...
Ingolme Posted July 21, 2009 Share Posted July 21, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.