|
Posted by Jerim79 on 04/06/07 19:11
On Apr 5, 5:02 pm, Tyno Gendo <u...@example.com> wrote:
> Jerry Stuckle wrote:
>
> [snip]
>
> >> So it does some data validation at the top. If $Email is empty, it
> >> shows the form on the screen for the user to fill out. It also puts
> >> the appropriate error message next to the email question. If $Email is
> >> not empty when the user clicks submit, the form verifies it is not
> >> empty, and then calls the next page. The obvious problem is that when
> >> the page first loads, it displays the error message.
>
> > Before validating see if $_POST['Submit'] contains 'Continue' or not. If
> > not, don't validate.
>
> Or you can wrap your checks with the following also, so it only does it
> on POST
>
> if ( $_SERVER["REQUEST_METHOD"] == "POST" ) {
> // validation checks
>
> }
I like both of the ideas presented. Thanks so much. The answer is
always obvious after someone points it out :)
Navigation:
[Reply to this message]
|