// Refresh of the data
if (isset($_POST)){
if(!empty($_POST['action'])) $action = $_POST['action']; else $action = "";
if(!empty($_POST['phone'])) $phone = $_POST['phone']; else $phone = "";
if(!empty($_POST['email'])) $email = $_POST['email']; else $email = "";
if(!empty($_POST['login'])) $login = $_POST['login']; else $login = "";
if(!empty($_POST['password'])) $password = $_POST['password']; else $password = "";
}
$message = "";
if($action) {
// Phone
if(!isset($phone) || $phone == "") {
$message .= "Phone is null
";
} else {
if((!preg_match('`([0-9])`', $phone)) || (strlen($phone) < 10)) {
$message .= "Incorrect phone number
";
}
}
// Email
if(!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',$email)) {
$message .= "Incorrect email
";
}
// Login (de 4 à 16 caractères
if(!eregi("^[a-z0-9]{4,16}$", $login)) $message .= "Le login n'est pas correct
";
}
?>