kevinkhan Posted January 25, 2010 Share Posted January 25, 2010 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 $fields_with_lengths = array('menu_name' => 30); foreach($fields_with_lengths as $fieldname => $maxlength) { if(strlen(trim(mysql_prep($_POST[$fieldname]))) > $maxlength) { $errors[] = $fieldname; } } as i want make an error array with all the errors from other fields as well.. Thanks for your help.. Link to comment https://forums.phpfreaks.com/topic/189774-need-help-with-validating-this/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.