Erreur fatale : appel à une fonction inconnue sha()

Solved
Zakarya93 Posted messages 1026 Status Member -  
Zakarya93 Posted messages 1026 Status Member -
Hello,

I have this error: Fatal error: Call to undefined function sha() in C:\wamp\www\rs\functions\login.func.php on line 9

My login.func.php:

<?php //the function that will verify the combination username/password function verifier_combinaison_pseudo_password($pseudo,$password) { $pseudo = htmlspecialchars(strip_tags($_POST['pseudo'])); $password = htmlspecialchars(strip_tags($_POST['password'])); $password = sha($password); $bdd = new PDO('mysql:host=localhost;dbname=rs;charset=utf8', 'root', ''); //therefore, the verification: $req = $bdd->query('SELECT COUNT(*) FROM utilisateurs WHERE pseudo="'.$pseudo.'" AND password="'.$password.'"'); $etat = $req->fetchColumn(); if($etat == 0){ return 0; }else{ return 1; } } ?>


What should I do? Thanks in advance :)

1 answer

Zakarya93 Posted messages 1026 Status Member 10
 
I replaced it with sha1_file() but I have:

Warning: sha1_file(pokemon): failed to open stream: No such file or directory in C:\wamp\www\rs\functions\login.func.php on line 9
0
Zakarya93 Posted messages 1026 Status Member 10
 
Resolved, I used SHA-1 instead
0