I am having a weird issue issue where PHP applications that use form checking are not working correctly. One of them checks the email password format of the info a new user enters when they register. When submitting the form the check thinks that the formats are wrong, even though they are correct. I have seen this issue with two different php apps, both of which work fine on another server. And if I comment out the check code the app works (but doesn't validate the format of course) Has anyone ever ran across this issue or have any thoughts on it? I am currently running on Apache 2.0.63 and PHP 4.3.9. I am thinking it is an issue with PHP but am not 100% sure how to track it down.
I did not write the code but if I comment out this line it allows the user to register. $fv->isEmailAddress('email',"$lang[formcheck_emailinv]"); And I believe this is the code that is checking the format. // check whether input is a valid email address function isEmailAddress($field, $msg) { $value = $this->_getValue($field); $pattern = "/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/"; if(preg_match($pattern, $value)) { return true; } else { $this->_errorList[] = array("field" => $field, "value" => $value, "msg" => $msg); return false; } } Note that I am having this issue with apps such as Word Press, which works on another server. Thanks for your help!
Looking deeper into it... it seems that the issue is with preg_match. Looks like non of the code that uses it is working.
Ok, I determined that I can run php script from the bash prompt fine. However whenever I run them from a browser preg_match always returns false. Any thoughts why this would be?