Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <?php
- include './PHP/cnx.php';
- if(isset($_POST['Connection']))
- {
- if(!$_POST['Mail']=="" )
- {
- if(!$_POST['mdp']=="")
- {
- $sql = $cnx->prepare("SELECT idEtudiant FROM etudiants, WHERE email ='".$_POST['Mail']."'AND motDePasse = '".$_POST['mdp']."'");
- $sql->execute();
- $connexion = $sql->fetch(array('e.email' => $_POST['Mail'],'e.motDePasse' => $_POST['mdp']));
- if (!$connexion)
- {
- header('Location:./index.php');
- die();
- }
- else
- {
- s_start();
- s_connexion_2('id', $connexion['id']);
- s_connexion_2($_POST['Mail']);
- header('Location:./PHP/page2.php');
- die();
- }
- }
- else
- {
- echo "Veuillez saisir un mot de passe !";
- }
- }
- else
- {
- echo "Veuillez saisir un e-Mail !";
- }
- }
- ?>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>QCM</title>
- </head>
- <body>
- <div align="center">
- <h2>Connexion</h2>
- <br/><br/>
- <form method="POST" action="">
- <label for="Mail">Mail: </label>
- <input type="email" placeholder="Votre Mail" id ="Mail" name="Mail"/>
- <br>
- <label for="mdp"> Mot de passe: </label>
- <input type="password" placeholder="Votre mot de passe" id ="mdp" name="mdp"/>
- <br>
- <input type="submit" name="Connection" value="Se connecter" id="Connection" />
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement