Is there any code I can enter that will save the data in the input fields?
I have a <form action=verify.php etc etc
and on verify.php I have a ton of validation terms, with a
click <a href='javascript:history.go(-1)'>here</a> to go back
and when it does, the fields are blank, how do i get it to save the data?
cheers
Forms
Moderator: General Moderators
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
If you're using sessions, its cake!
Code: Select all
<input type="text" name =name <?php if(isset($_SESSION['name'])) echo "value="$_SESSION[name]"";?> >- MarK (CZ)
- Forum Contributor
- Posts: 239
- Joined: Tue Apr 13, 2004 12:51 am
- Location: Prague (CZ) / Vienna (A)
- Contact:
Well, when you submit a form, you push a lot of data with it, right? So, just make a link backwards but with all the data (e.g. whole $_GET array) attached to it as part of URL.
Then in the form will just be:
Then in the form will just be:
Code: Select all
<INPUT TYPE="text" NAME="textField1" VALUE="<?= textField1 ?>">Update - the top of my page has the following code
This gave no errors - I changed the order knowing the session_start should be first.
it works, BUT if I use the <a href=page.php>click me to go back</a> the information is lost. However, the back button as well as the JS (see oldpr0, you was wrong
) works liek a charm
excellent, thanks mark (shooter) & everyone!!!!!!
Code: Select all
<?
header("Cache-control: private");
session_start();
?>it works, BUT if I use the <a href=page.php>click me to go back</a> the information is lost. However, the back button as well as the JS (see oldpr0, you was wrong
excellent, thanks mark (shooter) & everyone!!!!!!