Invoke the browser back button in PHP/Javascript
<p>I have a form which sends the user to a different form incase they don't complete it to go back to the form and complete anything that was missed. Now unless the user presses the browser back button the page is loaded fresh which mean any data gets lost.</p>

<p>Pretty much when they come back to the previous page, anything they already filled in should stay intact.</p>

<p>I have the following two pages:</p>

<p>Page 1:</p>

<pre><code>&lt;?PHP

echo "&lt;a href='page2.php'&gt;NEXT&lt;/a&gt;";
echo "&lt;input type=text size=25 name=txt /&gt;";
?&gt;
</code></pre>

<p>Page 2:</p>

<pre><code>&lt;?php
$refer = $_SERVER['HTTP_REFERER'];
$lastlink = "&lt;a href='$refer'&gt;BACK&lt;/a&gt;";

echo $lastlink;
?&gt;
</code></pre>

<p>On page two if i click BACK to come back to page 1, anything entered in page 1 will be lost which I do not want.
How do I work around it without using Javascript? with Javascript?
I know in javascript  I can use</p>

<pre><code>&lt;a href="javascript:history.go(-1);"&gt;BACK&lt;/a&gt;
</code></pre>

<p>But is there another way?</p>
