Make the form page post to itself and use default values of <?php echo
$HTTP_POST_VARS['field_name'] ?>. The initial form will be blank, but
subsequent failing attempts will have the values the visitor already
entered. You can also add red text to the form to show what exactly was
wrong, etc.
Then, to handle posts that are successful, you'll need to use something
like this:
if (<successful post>) { // post is acceptable - process the info
include("file/to/handle/post.php");
} else { // post failed
?>
<!-- put HTML form page here -->
<?php
} // end if
?>
I know some people might say this is bad style, but it works. It can be
cleaned up some, but this is good enough IMO.
--toby
kaab kaoutar wrote:
>
> Hi!
> What's best ? using client script while validating form inputs(javasript or
> vbscript) or using php for validating!
> with the first way, i can trigger alert ! however with the second one, i
> have to show up a whole page for just saying that there are errors, go back
> to the form !
> any ideas ?
> thanks
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]