Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <link href="styles.css" rel="stylesheet">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <body>
- <div class="container-fluid text-center">
- <br>
- <div class="container-fluid text-center">
- <div class="margin">
- <?php
- include'./function.php';
- startsession();
- //Procédure stocké PHP
- if (isset($_POST["valid"]))
- {
- try
- {
- $connstrg = ("mysql:host=localhost;dbname=anti_cheat");
- $user = ("root");
- $password = ("oopkopok");
- $PDO = new PDO($connstrg,$user,$password);
- echo'1';
- $valide = true;
- }
- catch (Exception $ex)
- {
- $msg = "Une erreur ces produit à la ligne " . $ex->getLine() . " Dans le fichier " . $ex->getFile() . " Le message d'erreur est " . $ex->getMessage();
- echo $msg;
- $valide = false;
- }
- //si aucune erreur de connexion
- if($valide)
- {
- echo'2';
- $query = ("CALL select_login(:P_admin);");
- $prep =$PDO->prepare($query);
- $prep->bindParam(':P_admin', $_POST["admin"]);
- //echo json_encode($prep->errorInfo());
- $prep->execute();
- echo'3';
- if($resultat=$prep->fetch())
- {
- echo'4';
- $_SESSION["user"]=$_POST["admin"];
- header("location:intra.php");
- }
- else
- {
- if($resultat["Admin"] != $_POST["admin"])
- {
- echo"<div class='alert alert-danger'><strong>Informations éronné </div>";
- }
- }
- }
- }
- ?>
- <form method="POST">
- <h5 class="text-center">Veuillez entrez votre code d'accès</h5>
- <br>
- <?php
- if(isset($_POST["admin"]) && $_POST["admin"] == "")
- {
- echo"<div class='alert alert-danger'><strong>Le code d'accès est invalide </div>";
- }
- ?>
- <div class='titre'>Code d'accès</div>
- <br>
- <input class='' type='text' name='admin' placeholder="Veuillez entrez votre code d'accès">
- <br>
- <input type='submit' name='valid' value='Continuer'>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement