Jump to content

Need help with validating this


kevinkhan

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.