Advertisement
Guest User

Untitled

a guest
Jun 19th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $nonavbar = '';
  4. include 'init.php';
  5. //include $langs . 'ar.php';
  6. if ($_SERVER['REQUEST_METHOD'] == 'POST'){
  7. $username = $_POST['user'];
  8. $password = $_POST['pass'];
  9. $hashpass = sha1($password);
  10.  
  11. $stmt = $con -> prepare("SELECT username,password FROM user WHERE username = ? AND password = ? AND gropid = 1");
  12. $stmt -> execute(array($username, $password));
  13. $cont = $stmt -> rowCount();
  14. if($cont > 0){
  15. $_SESSION['username'] = $username;
  16. header('location:home.php');
  17. exit();
  18. }
  19. }
  20. ?>
  21.  
  22. <form class="login" action="<?php echo $_SERVER['PHP_SELF']?> " method="POST">
  23. <h2 class="text-center">Admin login </h2>
  24. <input class="form-control" type="text" name="user" placeholder="username" autocomplete="off" />
  25. <input class="form-control" type="password" name="pass" placeholder="passowrd" autocomplete="new-passowrd" />
  26. <input class="btn btn-danger btn-block" type="submit" value="login" />
  27. </form>
  28.  
  29. <?php
  30. include $temp . 'footer.php';
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement