Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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"]=$resultat["Admin"];
- header("location:intra.php");
- }
- else
- {
- if($resultat["Admin"] != $_POST["admin"])
- {
- echo"<div class='alert alert-danger'><strong>Informations éronné </div>";
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement