PicnicTutorials Posted May 24, 2009 Report Share Posted May 24, 2009 Hello, I'm stuck. I'm cleaning my email with this below. But I don't want it to run an error if the field is left blank. In other words, I want to clean it "if" stuff is input, but I also want it to send if there is nothing input. Currently it won't send the form if no input. How to edit? Thanks! // Clean Email if (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email)) { header( "Location: $errorurl" ); exit ; } Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted May 24, 2009 Report Share Posted May 24, 2009 // Clean Email if (!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email) && ( ! isblank($email))) { header( "Location: $errorurl" ); exit ; } Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted May 24, 2009 Author Report Share Posted May 24, 2009 Thanks Jim! But no go. It runs this error? I sure it's just missing some stupid symbol or something... Fatal error: Call to undefined function isblank() Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted May 24, 2009 Report Share Posted May 24, 2009 Uggg! try !empty($email) Quote Link to comment Share on other sites More sharing options...
Kelli_Kanyon Posted May 25, 2009 Report Share Posted May 25, 2009 isblank() is NOT a PHP function Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted May 25, 2009 Author Report Share Posted May 25, 2009 Uggg! try !empty($email) Thank you very much Jim - that worked perfect! Have a nice holiday! Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted May 25, 2009 Report Share Posted May 25, 2009 Welcome, and we had our Holiday last weekend (Canuck). 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.
Note: Your post will require moderator approval before it will be visible.