Well if we are going to do it we may as well do it as a Jazajay way and no guessing involved.
PHP I would do it like this, I've only tought myself PHP not ASP so if you need that or another language maybe you can backwards engineer it after you see the code.
Change the form to submit to it's self.
PHP Code:
<form action="thispage.php" method="post">
<p>
<input type="text" name="hello" <?php if(isset($_SESSION['name'])){echo"value=\"".$_SESSION['name']."\"";$_SESSION['name']=""}?> />
<input type="submit" value="send" />
</p>
</form>
Then above the doctype for that page create this.
PHP Code:
<?php
session_start();
if(isset($_POST['hello']) && !empty($_POST['hello']))
{
$_SESSION['name']=$_POST['hello'];
$_SESSION['page']="the-path-to-this-page-made-url-freindly.php";
header("Location: your other page you want the back button on.php");
}
?>
Then on the page with the button on create this
PHP Code:
<?php
if(isset($_SESSION['name']))
{?>
<a href="<?php echo $_SESSION['page']?>"><img src="../images/back.png" alt="problem with query please go back" /></a>
<?php }?>
Ok in case you don't know php and use a different language. Lets go through it.
1. You start off by getting the form to submit to the same page it's on.
If it is submitted the if block above the doctype will execute if it hasn't it wont and will load the form.
2. If the form has been submitted you place the form contents into a session, this could be an array, and the page name for this form in it's URL form.
You could create a function if it is a dynamic page, or if you ask nicely I might do it.
3. You test to see if the session is set. If it is you display the sesssion and the link back to the page with the form.
If it's set the form has been submitted, if it hasn't the page was loaded directly so the button would equal nothing so don't display it.
4. Then if they click the button they go back to the previous page and the form is populated using the data in the session. The session is then set to empty.
1 accessable form done the Jazajay way.
Remember to start the session with session_start(); on the top of the page you want the button on.
Jaza
Bookmarks