Posted by David Haynes on 03/13/06 13:21
desh wrote:
> hello
>
> How to retain the values in form tag ,in case user enter wrong
> information.
>
One way is to do something like this:
form1.php displays the form and has <input> fields in it. The form has
an action - say form1.ctrl.php and will use the POST method.
form1.ctrl.php processes the $_POST array and saves the values into a
$_SESSION when an error occurs (along with an error message). It then
redirects to form1.php.
form1.php sees the values in the $_SESSION and puts them back into the
form <input> using the value="" argument.
You can use GET instead of PUT.
You can use GET instead of SESSION.
It really depends on what you need.
-david-
Navigation:
[Reply to this message]
|