I’m using the WebSignup snippet which you can elect to install with the default Modx install, along with the supplied FormSignup chunk. This should check that the email address entered into the form is in a valid format. Looking at the PHP code in websignup.inc.php there is this section
// verify email
if($email=='' || !ereg("^[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+", $email)){
$output = webLoginAlert("E-mail address doesn't seem to be valid!").$tpl;
return;
}
This however doesn’t work as I can put anything into the email field and it’ll accept it. The server is running PHP version 5.2.10 and although the ereg function is listed as depreciated in PHP 5 it should still work. Is the reg exp supplied with the snippet actually wrong? What should it be to check that the email is in a valid format?