Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Login</title>
- <link rel = "stylesheet" href= "restaurant/main.css" type= "text/css" media="all"></link>
- </head>
- <body>
- <div id="login">
- <title>Administrator Panel</title>
- <head><b>Welcome to the administrator panel for the Shahnaz Restaurant Order System.</b></head>
- <form method="post" action="admin.php">
- <p><b>Please log in as an administrator by filling in the form below.</b></p>
- <p>Username:</p>
- <p><input type="text" name="username"/></</p>
- <p>Password:</p>
- <p><input type="password" name="password"/></p>
- <p><input type="Submit" value="Log in"/></p>
- </form>
- </div>
- <?php
- session_start();
- if (isset($_GET["logoutprofile"])) {
- $_SESSION["logged"] = false;
- header("location: logout.php");
- }
- if (isset($_SESSION['login']) == true){
- header("location: profile.php");
- }
- if(count($_POST) > 0){
- include("dbconnection.php");
- $username =($_POST['username']);
- $password =($_POST['password']);
- $qry = mysql_query("SELECT * FROM adminlogin WHERE ( username = '$username')") or die(mysql_error());
- if (mysql_num_rows($qry) > 0){
- $row = mysql_fetch_array($qry, MYSQL_ASSOC) or die(mysql_error());
- if ($adminlogin['password'] == ($_POST['password']) &&
- $row['username'] == ($_POST['username'])){
- $_SESSION['login'] = $row['id'];
- } else {
- echo "Wrong Username or Password";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement