You are here: Re: retaining form values « PHP Programming Language « IT news, forums, messages
Re: retaining form values

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация