Guest User

Untitled

a guest
Dec 16th, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7.  
  8. //$username = 'test';
  9. //$password = 'password';
  10.  
  11.  
  12. $conn = mysqli_connect("sql310.epizy.com", "epiz_20863901", "8reSoe0CHZ", "epiz_20863901_SkoleSystem");
  13. $result = mysqli_query($conn, "SELECT * FROM Login WHERE Username='$username' && Password='$password'");
  14. if (mysqli_num_rows($result) > 0) {
  15. while ($row = mysqli_fetch_assoc($result)) {
  16. echo "Login success!";
  17. $_SESSION['id'] = $row['Id'];
  18. header("Location: admin.php");
  19. } else {
  20. echo '<script>alert("Wrong Infomation!");</script>';
  21. header('Refresh: 0.25; URL=login.php');
  22. }
  23.  
  24. ?>
Add Comment
Please, Sign In to add comment