Javascript Back Button

This simple script operates the same way as the back button in a visitor's browser.

<a href="#" onClick="history.go(-1)">Back</a>

Where possible, you should also include the previous page in the href section of the link. For instance in PHP you can access the referrer as below:

<?php
$referrer=$_SERVER['HTTP_REFERER'];
?>
Category: 

Add new comment