I have a weird issue with hash:sha512(works perfectly, except when i tried logging in with wrong password
<p>session_start();</p>

<pre><code>if(isset($_SESSION['logged'])){
    header('Location: esm_questionnaire.php');
}
if(isset($_POST['utilisateur'])&amp;&amp;isset($_POST['motdepasse'])){
    $con = mysql_connect('localhost','root','');
    mysql_select_db('esm_quiz', $con);
    $datID = mysql_real_escape_string($_POST['utilisateur']);
    $datPASS = $_POST['motdepasse'];
    $datPASS = hash(sha512, $datPASS);
    $SQL = "SELECT * FROM esm_sujets WHERE code_exp = '$datID'";
    $result = mysql_query($SQL, $con);
    $row = mysql_fetch_array($result);
    if($result){
        if($datPASS === $row['pass_exp']){
            $_SESSION['logged'] = true;
            $_SESSION['sexe'] = $row['sexe'];
            $_SESSION['type'] = $row['type_attachement'];
            header('Location: esm_questionnaire.php');
        }
        else{
            die('Vous n&amp;#39;avez pas acces');
            }
    }
    }
</code></pre>

<p>Notice: Use of undefined constant sha512 - assumed 'sha512' in C:\wamp\www\Nouveaudossier\esm_connexion.php on line 12</p>

<p>this is the error i get if i have a wrong password or username</p>
