Jump to content

email array checking validity of email address


verN

Recommended Posts

I had the following working but since I changed the email variable to an array it doesn't work. email[] This is part of an edit form where emails in the mailing lists can get updated however, before they get updated i need to check that each of the email addresses are valid.But the code doesn't work for the array.

 

// checks for a email address through POST.
         if ((isset($_POST['email']))) { 
             $eAdd=$_POST['email'];
	 }

 

 if (eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', stripslashes($_POST['email']))) {
          //stores the email address
        	 $eAdd= trim($_POST['email']); 
             } else {
        	 $error[]= 'Please enter a valid email address!';
        	 }

 

thanks

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.