php - Email Validation on user registration form -
this question has answer here:
- how validate email address in php 8 answers
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
Post a Comment