Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $erreur=0;
- if (isset($_REQUEST["log"])){
- $log= htmlentities ($_REQUEST["log"]);
- }
- if (isset($_REQUEST["mdp"])){
- $mdp= htmlentities($_REQUEST["mdp"]);
- }
- if (isset($_REQUEST["log"])){
- require 'slqconnect.php';
- $requete="SELECT statut,mdp FROM admin WHERE pseudo=".$connection->quote($log);
- $data=$connection->query($requete);
- $ligne= $data->fetch();
- if(password_verify($mdp,$ligne['mdp'])){
- if($ligne['statut']==1){
- $_SESSION['login']="admin";
- header('Location: fnachtml.php');
- }
- if($ligne['statut']==2){
- $_SESSION['login']="user";
- header('Location: fnachtml.php');
- }
- }
- $erreur=1;
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Fnac</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <h1>AUTHENTIFICATION</h1>
- <?php
- if($erreur==1){
- echo("Echec d'authentification !");
- }
- ?>
- <p>
- <form action='authentification.php' method="GET">
- Login :
- <input type="text" value="" name="log" />
- <br />
- Mot de passe :
- <input type="text" value="" name="mdp" />
- <br />
- <br />
- <input type="submit" value="Valider" />
- </form>
- </p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement