Hello!
I am trying to validate a form... I have some success, being able to prevent a blank variable, a variable less than 2 characters, or a varaible mroe than 35 characters.
I am not having luck preventing someone from entering a number in the name field though.. What am I doing wrong?
if(empty($fname))
{
die ("No first name entered! Press the BACK button and add a first name. ");
}
elseif ( (strlen($fname) < 2) || (strlen($fname) > 25))
{
die("Invalid first name! Press the BACK button and edit the first name.");
}
elseif (eregi ("^[A-Z]+$", $_POST['fname']))
{
die("Invalid first name! Press the BACK button and edit the first name.");
}
else
{
etc.