|
@ -1,7 +1,30 @@ |
|
|
<!-- Traitement PHP --> |
|
|
<!-- Traitement PHP --> |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
/* |
|
|
|
|
|
Faire de la sécurité et de l'optimisation |
|
|
|
|
|
Ce code est pourri mais VRAIMENT |
|
|
|
|
|
*/ |
|
|
|
|
|
$servername = 'mysql-serny-nsi.alwaysdata.net'; |
|
|
|
|
|
$username = 'serny-nsi'; |
|
|
|
|
|
$mdp = 'ecole9090*'; |
|
|
|
|
|
|
|
|
|
|
|
$bdd = new PDO('mysql:host=mysql-serny-nsi.alwaysdata.net;dbname=serny-nsi_main', $username, $mdp); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['submit'])) { |
|
|
|
|
|
if (isset($_POST["f_email"]) AND !empty($_POST["f_email"]) AND isset($_POST["f_password"]) AND !empty($_POST["f_password"])) { |
|
|
|
|
|
$password = htmlspecialchars($_POST['password']); |
|
|
|
|
|
$mail = htmlspecialchars($_POST['f_email']); |
|
|
|
|
|
|
|
|
|
|
|
$look = $bdd->("SELECT * FROM membres WHERE email = ?"); |
|
|
|
|
|
$look->execite(array($mail)); |
|
|
|
|
|
$userexist = -1; |
|
|
|
|
|
$userexist = $look->rowCount(); |
|
|
|
|
|
if ($userexist == 0) { |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
$erreur = "Le mail utilisé est inconnu." |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
<!DOCTYPE html> |
|
|
<!DOCTYPE html> |
|
@ -36,6 +59,9 @@ |
|
|
<input type="submit" name="" value="Se connecter" id="submit"> |
|
|
<input type="submit" name="" value="Se connecter" id="submit"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
|
|
|
<?= $erreur ?> |
|
|
|
|
|
</div> |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
</body> |
|
|
</body> |
|
|