“Go Back” Button


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <input type="button" value="Go Back" onclick="history.back(-1)" />
  2.  
  3.  
  4. ----------------------------------------------------------------------
  5.  
  6.  
  7. PHP Version:
  8. <?php
  9. $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  10. echo "<a href='$url'>back</a>";
  11. ?>

URL: http://css-tricks.com/snippets/javascript/go-back-button/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.