I am trying to use a back button to allow a user to change submitted form
values.
The problem I am having is that when they submit the form a second time,
regardless of what is entered, the variable $test does not change and keeps
only the first value assigned to it! I am able to solve this by using
session_unset($test); but I don't understand what is happening/why I should
need to do this.
Any help appreciated, here is some sample code to illustrate. Running this,
only what is typed in first for $test is kept after that it will not take on
new values!
1.php
-------
<?php session_register("test");?>
<a href="2.php">NEXT</a>
2.php
-------
<?php session_start();?>
<form name="form1" id="form1" method="post" action="3.php">
<input type="text" name="test" id="test" value="<?php echo $test;?>"/>
<input type="submit" name="Submit" value="Submit" />
</form>
3.php
-------
<?php session_start();
echo "You entered: ".$test; ?>
<a href="2.php">START OVER</a>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php