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 Quote Link to comment 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}$"; Quote Link to comment 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 Quote Link to comment 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}$/"; Quote Link to comment 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.