page1.html : contains a form the user inputs details into. this loads the data into:
page2.php : this runs a query against the input data, and displays the results. Each line of the results has a link to:
page3.php : this displays further information on each item. From here I want to be able to go back to page2.php, but without re-running the query (this works fine when using the browsers back button).
Is there a way to achieve this using html/php/javascript.
someone suggested:
Code: Select all
<script>
function backhref(a) {
if (document.referer == a.href) {
history.back();
return false
}}
</script>
Code: Select all
<p><a href="page2.php" onclick="return backhref(this)">back</a></p>