Need help with this form validation Please
Posted: Mon Jan 25, 2010 2:31 pm
I have a from with this field in it
<label>Email:</label>
<input type="text" name="email" id="email" />
I want to make sure a user enters the correct format of an email address.. Is there anyway of checking this??
if possible could you right it in this format
as i want make an error array with all the errors from other fields as well..
Thanks for your help..
<label>Email:</label>
<input type="text" name="email" id="email" />
I want to make sure a user enters the correct format of an email address.. Is there anyway of checking this??
if possible could you right it in this format
Code: Select all
$fields_with_lengths = array('menu_name' => 30);
foreach($fields_with_lengths as $fieldname => $maxlength)
{
if(strlen(trim(mysql_prep($_POST[$fieldname]))) > $maxlength)
{
$errors[] = $fieldname;
}
}Thanks for your help..