Browse Source

sign_in.php

master
sacha.serny 3 years ago
parent
commit
e7d5a9aeed
  1. 26
      sign_in.html

26
sign_in.html

@ -1,7 +1,30 @@
<!-- Traitement 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>
@ -36,6 +59,9 @@
<input type="submit" name="" value="Se connecter" id="submit">
</div>
</div>
<div>
<?= $erreur ?>
</div>
</form>
</div>
</body>

Loading…
Cancel
Save