Advertisement
Guest User

Untitled

a guest
May 1st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <title>Login</title>
  5.  
  6. <link rel = "stylesheet" href= "restaurant/main.css" type= "text/css" media="all"></link>
  7.  
  8. </head>
  9.  
  10. <body>
  11.  
  12. <div id="login">
  13.  
  14. <title>Administrator Panel</title>
  15. <head><b>Welcome to the administrator panel for the Shahnaz Restaurant Order System.</b></head>
  16.  
  17. <form method="post" action="admin.php">
  18. <p><b>Please log in as an administrator by filling in the form below.</b></p>
  19. <p>Username:</p>
  20. <p><input type="text" name="username"/></</p>
  21. <p>Password:</p>
  22. <p><input type="password" name="password"/></p>
  23. <p><input type="Submit" value="Log in"/></p>
  24.  
  25. </form>
  26.  
  27. </div>
  28.  
  29.  
  30. <?php
  31.  
  32. session_start();
  33.  
  34. if (isset($_GET["logoutprofile"])) {
  35. $_SESSION["logged"] = false;
  36. header("location: logout.php");
  37. }
  38.  
  39. if (isset($_SESSION['login']) == true){
  40. header("location: profile.php");
  41. }
  42. if(count($_POST) > 0){
  43. include("dbconnection.php");
  44. $username =($_POST['username']);
  45. $password =($_POST['password']);
  46. $qry = mysql_query("SELECT * FROM adminlogin WHERE ( username = '$username')") or die(mysql_error());
  47.  
  48.  
  49. if (mysql_num_rows($qry) > 0){
  50.  
  51. $row = mysql_fetch_array($qry, MYSQL_ASSOC) or die(mysql_error());
  52.  
  53. if ($adminlogin['password'] == ($_POST['password']) &&
  54. $row['username'] == ($_POST['username'])){
  55. $_SESSION['login'] = $row['id'];
  56. } else {
  57. echo "Wrong Username or Password";
  58. }
  59. }
  60.  
  61. ?>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement