Email检测,密码重复检测,可以用于表单发送的各种环境,例如发送反馈,注册帐号
<div id="container"> <BR> <?if( isset($_POST['send']) && (!validateName($_POST['name']) || !validateEmail($_POST['email']) || !validatePasswords($_POST['pass1'], $_POST['pass2']) || !validateMessage($_POST['message']) ) ):?> <BR> <div id="error"> <BR> <ul> <BR> <?if(!validateName($_POST['name'])):?> <BR> <li><strong>Invalid Name:</strong> We want names with more than 3 letters!</li> <BR> <?endif?> <BR> <?if(!validateEmail($_POST['email'])):?> <BR> <li><strong>Invalid E-mail:</strong> Stop cowboy! Type a valid e-mail please :P</li> <BR> <?endif?> <BR> <?if(!validatePasswords($_POST['pass1'], $_POST['pass2'])):?> <BR> <li><strong>Passwords are invalid:</strong> Passwords doesn't match or are invalid!</li> <BR> <?endif?> <BR> <?if(!validateMessage($_POST['message'])):?> <BR> <li><strong>Ivalid message:</strong> Type a message with at least with 10 letters</li> <BR> <?endif?> <BR> </ul> <BR>
<?elseif(isset($_POST[‘send’])):?>
- Congratulations! All fields are OK
<?endif?>
What’s your name?
Valid E-mail please, you will need it to log in!
At least 5 characters: letters, numbers and ‘_’
Confirm password