I am working with a form validation script; I am testing it first and all seems to work fine except for the email validation.
This is a snippet of the script dealing with the email validation:
else if(! eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email ))
{
$_SESSION['reg']['email']="Please enter valid email address.";
For example, if a User enters the following in the email field, an error message is displayed, obviously: test1
If they enter test1@, an error is displayed.
If they enter test1@gmail.c an error is displayed.
But...
If they enter test1@gmail.co OR, for example, test1@gmail.cop it is validated as true - No error message displayed.
This makes absolutely no sense to me.
This is from that snippet, specifically handling User input of their email address
("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})
I am not familiar with the above at all and am not sure what to do to remedy this issue.
You can view and try this live if you wish: http://www.redlinedown.com/jQuery/registration/index.php
Thank you in advance for any help!
Matthew