Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <?php
  8. include './PHP/cnx.php';
  9.  
  10. if(isset($_POST['Connection']))
  11. {
  12.  
  13. if(!$_POST['Mail']=="" )
  14. {
  15.  
  16. if(!$_POST['mdp']=="")
  17. {
  18. $sql = $cnx->prepare("SELECT idEtudiant FROM etudiants, WHERE email ='".$_POST['Mail']."'AND motDePasse = '".$_POST['mdp']."'");
  19.  
  20. $sql->execute();
  21. $connexion = $sql->fetch(array('e.email' => $_POST['Mail'],'e.motDePasse' => $_POST['mdp']));
  22.  
  23. if (!$connexion)
  24. {
  25. header('Location:./index.php');
  26. die();
  27. }
  28. else
  29. {
  30. s_start();
  31. s_connexion_2('id', $connexion['id']);
  32. s_connexion_2($_POST['Mail']);
  33. header('Location:./PHP/page2.php');
  34. die();
  35. }
  36. }
  37.  
  38. else
  39. {
  40. echo "Veuillez saisir un mot de passe !";
  41. }
  42. }
  43.  
  44. else
  45. {
  46. echo "Veuillez saisir un e-Mail !";
  47. }
  48. }
  49. ?>
  50.  
  51. <html>
  52. <head>
  53. <meta charset="UTF-8">
  54. <title>QCM</title>
  55. </head>
  56. <body>
  57.  
  58. <div align="center">
  59. <h2>Connexion</h2>
  60. <br/><br/>
  61. <form method="POST" action="">
  62.  
  63. <label for="Mail">Mail: </label>
  64. <input type="email" placeholder="Votre Mail" id ="Mail" name="Mail"/>
  65. <br>
  66. <label for="mdp"> Mot de passe: </label>
  67. <input type="password" placeholder="Votre mot de passe" id ="mdp" name="mdp"/>
  68. <br>
  69. <input type="submit" name="Connection" value="Se connecter" id="Connection" />
  70. </form>
  71. </div>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement