php - Email Validation on user registration form -


this question has answer here:

my code not running properly. doing wrong? please suggest. here code:

 elseif(!preg_match("/^[_\.0-9a-za-z-]+@([0-9a-za-z][0-9a-za-z-]+\.)+[a-za-z]{2,6}$/i", $email))    {   $errormsg= "error: did not enter valid email.";   $code= "3";   } 

please use data validation filters available in php.

http://php.net/manual/en/filter.filters.validate.php

example.

if (filter_var($email, filter_validate_email) === false) {   echo("please enter valid email address"); } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -