[thelist] Multiple form submit (back button issue)

RUST Randal RRust at COVANSYS.com
Wed Jan 29 07:18:01 CST 2003


Josh Feingold said:

> I always struggle with multi-page forms that the user might
> hit the back button wanting to change previous data.

Here is what I've been doing with PHP. If this isn't clear enough, let
me know.

When the user submits page1.php, it posts to itself
(page1.php?id=5&name=randal&company=covansys&save=Save). If the values
check out OK, then I forward the user to page2.php with the header()
function. I simply attach the query string (minus the save action) to
the page2.php (page2.php?id=5&name=randal&company=covansys).

Then I populate hidden fields in page2.php with the necessary values.

If I have to go back to page1.php, then I am going back to
page1.php?id=5&name=randal&company=covansys&save=Save. Because "save" is
true, the script pulls the values from the string and puts them into the
fields.

<input type="text" id="name" name="name" value="<?=$name ? $name : "";
?>" />

----------
Randal Rust
Covansys Corp.
Columbus, OH



More information about the thelist mailing list