Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="UTF-8">
  5.         <title></title>
  6.         <link href="styles.css" rel="stylesheet">
  7.          <meta name="viewport" content="width=device-width, initial-scale=1">
  8.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  9.         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  10.         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  11.     <body>
  12.         <div class="container-fluid text-center">
  13.             <br>
  14.             <div class="container-fluid text-center">
  15.                 <div class="margin">
  16.                    
  17. <?php
  18. include'./function.php';
  19. startsession();
  20. //Procédure stocké PHP
  21. if (isset($_POST["valid"]))
  22. {
  23.    try
  24.    {
  25.     $connstrg = ("mysql:host=localhost;dbname=anti_cheat");
  26.     $user = ("root");
  27.     $password = ("oopkopok");
  28.     $PDO = new PDO($connstrg,$user,$password);
  29.    
  30.     echo'1';
  31.         $valide = true;
  32.     }
  33.     catch (Exception $ex)
  34.     {
  35.         $msg = "Une erreur ces produit à la ligne " . $ex->getLine() . " Dans le fichier " . $ex->getFile() . " Le message d'erreur est " . $ex->getMessage();
  36.         echo $msg;
  37.         $valide = false;
  38.     }
  39.    
  40.     //si aucune erreur de connexion
  41.     if($valide)
  42.     {
  43.        echo'2';
  44.         $query = ("CALL select_login(:P_admin);");
  45.         $prep =$PDO->prepare($query);
  46.         $prep->bindParam(':P_admin', $_POST["admin"]);
  47.         //echo json_encode($prep->errorInfo());
  48.         $prep->execute();
  49.         echo'3';
  50.         if($resultat=$prep->fetch())
  51.         {
  52.             echo'4';
  53.             $_SESSION["user"]=$_POST["admin"];
  54.             header("location:intra.php");
  55.         }
  56.         else
  57.         {
  58.              if($resultat["Admin"] != $_POST["admin"])
  59.             {
  60.                  
  61.                 echo"<div class='alert alert-danger'><strong>Informations éronné </div>";  
  62.             }
  63.         }
  64.     }
  65. }
  66.        
  67.         ?>
  68.  
  69.                     <form method="POST">
  70.                         <h5 class="text-center">Veuillez entrez votre code d'accès</h5>
  71.                         <br>
  72.                         <?php
  73.                         if(isset($_POST["admin"]) && $_POST["admin"] == "")
  74.                         {
  75.                             echo"<div class='alert alert-danger'><strong>Le code d'accès est invalide </div>";  
  76.                         }
  77.                        
  78.                         ?>
  79.                         <div class='titre'>Code d'accès</div>
  80.                         <br>
  81.                         <input class='' type='text' name='admin' placeholder="Veuillez entrez votre code d'accès">
  82.                         <br>
  83.                         <input type='submit' name='valid' value='Continuer'>
  84.                        
  85.                     </form>
  86.                
  87.             </div>
  88.         </div>
  89.     </body>
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement