RE: [PHP] How to make a form retain its info
| From: | Benton Jackson | Date: | Thu, 27 Jul 2000 18:17:50 +0000 |
| Subject: | RE: [PHP] How to make a form retain its info | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8628@lists.php.net to get a copy of this message | ||
Even better, program the first page so that it can take as input the fields
from the error page, and fill in the values that were already entered. You
can make a form it's one processing script with IF statements:
<?
if ($submit) {
//check for errors, save if needed
if (!Gronk) {
$GronkError=true; $Error=true;
}
if (!$error) {
// save it in the database.
echo "Data Saved.<br>\n";
}
}
if ($error || !$submit)
// form here, with values filled in:
?>
<form action="thisscript.php" method="post">
Gronk: <input type="text" name="Gronk"
value="<?=$Gronk?>">
<? if ($GronkError) echo "fill this field in, moron!<br>"; ?>
<input type="submit" name="submit" value="Send it in!">
</form>
<?
}
?>
> -----Original Message-----
> From: jb@signserv.signal.uu.se [mailto:jb@signserv.signal.uu.se]On
> Behalf Of Jonatan Bagge
> Sent: Thursday, July 27, 2000 12:52 PM
> To: Chris Murley
> Cc: Richard Kurth; Php
> Subject: Re: [PHP] How to make a form retain its info
>
>
> An even better way is to output a new form on the second page
> where all the
> data is already filled in
> (using the variables that was sent)
> And maybe a little red star or something to point out what was filled in
> incorrectly.
> So that they can change it and submit it again..
>
> // Jonatan Bagge
>
> Chris Murley wrote:
>
> > You Can't If they use the Back button, You could have them click a link
> > and go back to the page, then store te data in a database.
> >
> > On Thu, 27 Jul 2000, Richard Kurth wrote:
> >
> > > How do you make a form retain it's info when you have to use the back
> > > button to chance some information that is not correct.
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net