Consider seperating the checks and tell the user what they did and didn't
do correctly as that way you can put the incorrect fields in bold and red
fonts!  Users LOVE that.  And little custom messages like "Yo, your email
of $email is incorrect and what kind of first name is $firstname?!" And
maybe even tell them "You answered 85% of the fields correctly, all you
have are 15% more to go!"  Ahem.  Something like that :)  (hint: like an
array to hold errors and if errors is_array then share this unfortunate
news with the user, in a creative and useful manner.)

Regards,

Philip


 On Fri, 9 Mar 2001, Simon Garner wrote:

> From: "W.D." <[EMAIL PROTECTED]>
> 
> > Actually I tried a variation of what you gave me before and it didnt work.
> I
> > couldnt get yours to validate thanks. heres what I used
> > <?php
> >     if (getenv("REQUEST_METHOD") == "POST")
> >     {
> >         if (
> >             eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}$", $Email)
> >             && eregi("^[a-z0-9]$", $FirstName)
> >             && eregi("^[a-z0-9]$", $LastName)
> >         )
> >         {
> >             echo "thanks";
> >         }
> >         else
> >         {
> >             echo "error!";
> >         }
> >     }
> > ?>
> >
> > This is directly after the form using the registered vars $Email,
> > $FirstName, $LastName. So I dunno whats wrong..
> >
> 
> 
> Your regular expressions are incorrect.
> 
> Try:
> 
>         if (
>             eregi("^[a-z0-9\._-]+@[a-z0-9\.-]+\.[a-z]{2,3}$", $Email)
>             && eregi("^[a-z0-9]+$", $FirstName)
>             && eregi("^[a-z0-9]+$", $LastName)
>         )
> 
> 
> Cheers
> 
> Simon Garner
> 
> 
> -- 
> 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]

Reply via email to