} elseif (strlen($_POST['mdp']) < 6) {
    header('Location: ../vues/vue_inscription.php?Error=shortPwd');
    exit;
} elseif ($pwd != $vpwd) {
    header('Location: ../vues/vue_inscription.php?Error=diffPwd');
    exit;
} elseif (!$id) {
    header('Location: ../vues/vue_inscription.php?Error=emptyIdent');
    exit;
} elseif (!$email) {
    header('Location: ../vues/vue_inscription.php?Error=emptyMail');
    exit;
}
if ($action == 'Submit') {
    try {
        $stmt1 = getAccountById($id);
        if ($stmt1->rowCount()) {
            header('Location: ../vues/vue_inscription.php?Error=usedId');
            exit;
        }
        $stmt1 = getAccountByMail($email);
        if ($stmt1->rowCount()) {
            header('Location: ../vues/vue_inscription.php?Error=usedEmail');
            exit;
        }
        $idValidation = md5($id);
        $stmt2 = insertAccount($id, $email, $pwd, $idValidation);
    } catch (PDOException $e) {
        header('Location: ../vues/vue_inscription.php?Error=db');
        exit;
    }
示例#2
0
/**
 * @return array
 */
function getLogged()
{
    return getAccountById($_SESSION['account']);
}