nezbo Posted December 20, 2007 Share Posted December 20, 2007 Hi all is there any way to verify an email address... i am looking for something like this... if ($_POST['emailAddress'] like "%@%.%") Neil Quote Link to comment https://forums.phpfreaks.com/topic/82491-solved-php-email-verifcation/ Share on other sites More sharing options...
~n[EO]n~ Posted December 20, 2007 Share Posted December 20, 2007 Here <?php if (preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $_POST['emailAddress'])) { echo 'Email entered is valid'; } else { echo 'Email entered is not valid'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/82491-solved-php-email-verifcation/#findComment-419338 Share on other sites More sharing options...
nezbo Posted December 20, 2007 Author Share Posted December 20, 2007 cheers That worked a treat. Quote Link to comment https://forums.phpfreaks.com/topic/82491-solved-php-email-verifcation/#findComment-419357 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.