Jai Rangi wrote:
Greeting,
I hope this is the right place for this. If not please guide me.
I am having problem with my "Form". Code is below. I want to generate an error message if the required fields are not filled. If they are filled then I want to add them to the database and display the form again to make another entry. Database part is working fine. But when it exist with an error for blank entry, it wipe out all the values the user has entered, how can I save user input in case user does not have to enter all the values again.
Thank you for help.

Start a new thread next time please - don't reply to an existing thread. It makes it really hard to follow.

<tr><td><font color=<? echo($FONTCOLOR); ?>><i>Main Keywords for this search: * </i></font></td><td><input type="text" name="Keywords" size=60></td></tr>

You're not including the post values.

It should be something like:

......<input type="text" name="Keywords" value="<?php echo (isset($_POST['Keywords'])) ? htmlentities($_POST['Keywords']) : ''; ?>" size=60>......

or you could check everything before hand:

if (isset($_POST['Keywords'])) {
  $keywords = htmlentities($_POST['Keywords']);
} else {
  $keywords = '';
}

...
<input type="text" name="Keywords" value="<?php echo $keywords; ?>" size=60>
...

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to