Advertisement
Guest User

testdatabase

a guest
Apr 11th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. session_start();
  2. <html>
  3. <head>
  4. <style>
  5.  
  6. .button1 {
  7. background-color: #d81e56;
  8. border: none;
  9. color: white;
  10. padding: 30px 50px;
  11. text-align: center;
  12. text-decoration: none;
  13. display: inline-block;
  14. font-size: 16px;
  15. margin: 4px 2px;
  16. cursor: pointer;
  17. }
  18.  
  19. </style>
  20. </head>
  21. <body>
  22. <?php
  23. $Username = $_POST['Username'];
  24. $Password = $_POST['Password'];
  25. $admin = $_POST['adminvar'];
  26. require "connect.php";
  27.  
  28. $sql = "SELECT Username, Password, Role FROM vmsregistration WHERE Username='$Username' AND Password ='$Password' AND Role = '$admin'" ;
  29. $result = $conn->query($sql);
  30.  
  31. if ($result->num_rows > 0) {
  32.  
  33. $_SESSION["Username"] = $Username;
  34. //echo $_SESSION["Username"];
  35. header('Location: vmsadmin.php');
  36. }
  37. else{
  38. $_SESSION["Username"] = $Username;
  39. //echo $_SESSION["Username"];
  40. header('Location: vmsstaff.php');
  41.  
  42. }
  43.  
  44. ?>
  45.  
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement