Code:
<?php
if (isset($_POST['submit'])){
$error = array()
if (empty($_POST['mail'])) {
$error[] = 'Please Enter your Email and also confirm your mail';
} else {
if (preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['mail'])) {
$Email = $_POST['mail'];
} else {
$error[] = 'Your Email Address is Invalid ';
}
}
if (empty($_POST['pass'])) {
$error[] = 'Please Enter your password';
} else {
if (preg_match("/^[- a-z0-9,<>@()&\%$#!~`]{5,9}$/i", $_POST['pass'])) {
$Password1 = $_POST['pass'];
} else {
$error[] = 'Your password must be between 5 and 9 characters';
} else {
if ($Password1!=$conpass trim($_POST['conpass']){
$error[] = 'Your passwords do not match';
}
}
?>
<form action= "" >
<table>
<tr>
<td width="117">Password</td>
<td width="237"><input type="password" name="pass" size="18">*</td>
<td width="120">Confirm Password</td>``
<td width="241">
<input type="password" name="conpass" size="18"></td>
<td width="25"> </td>
<td width="38"> </td>
</tr>
</table>
</form>