drmota Posted January 15, 2011 Share Posted January 15, 2011 Hey guys, In my contact form i have the action: preg_match but i've come accross a problem. Problem: Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in C:\Program Files (x86)\wamp\www\ts\contact.php on line 34 Code: $error_message = ""; $email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$"; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; Thanks in advance Link to comment https://forums.phpfreaks.com/topic/224519-preg_match-php-help/ Share on other sites More sharing options...
dragon_sa Posted January 15, 2011 Share Posted January 15, 2011 I think you need to have it like this $email_exp = "/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$"; Link to comment https://forums.phpfreaks.com/topic/224519-preg_match-php-help/#findComment-1159738 Share on other sites More sharing options...
drmota Posted January 15, 2011 Author Share Posted January 15, 2011 Ok that took away the ^ problem. But then it shows this error message: Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in C:\Program Files (x86)\wamp\www\ts\contact.php on line 34 what now? Thanks Link to comment https://forums.phpfreaks.com/topic/224519-preg_match-php-help/#findComment-1159753 Share on other sites More sharing options...
dragon_sa Posted January 15, 2011 Share Posted January 15, 2011 $email_exp = "/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/"; Link to comment https://forums.phpfreaks.com/topic/224519-preg_match-php-help/#findComment-1159761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.