Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>TK Juicy Dawgs - Admin</title>
- <link href="css/index.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="wrapper">
- <div id="login_form">
- <b>TK Juicy Dawgs</b>
- <br />
- <br />
- <form method="post" >
- <input type="text" name="username" class="txt_box" title="USERNAME" placeholder="Username" required />
- <br />
- <br />
- <input type="password" name="password" class="txt_box" title="PASSWORD" placeholder="Password" required>
- <br />
- <br />
- <button name="enter" value="Login" title="LOGIN" class="login_button">Login</button>
- </form>
- <?php
- include 'database.php';
- if(isset($_POST['enter']))
- {
- $username=$_POST['username'];
- $password=$_POST['password'];
- {
- $pdo = Database::connect();
- $sql = "SELECT * FROM admin";
- foreach ($pdo->query($sql) as $row)
- '<tr>';
- '<td>'. $row['id'] . '</td>';
- '<td>'. $row['username'] . '</td>';
- '<td>'. $row['password'] . '</td>';
- // echo '<td>'. $row['link'] . '</td>';
- '</tr>';
- /*$count = mysql_num_rows($row);
- }
- if ($count == 0)
- {
- echo "<script>alert('Please check your username and password!'); window.location='login.php'</script>";
- }
- else if ($count > 0)
- {
- session_start();
- $_SESSION['id'] = $row['id'];
- header("location:index.php");
- }
- }*/
- }
- if ($username == $row['username'] && $password == $row['password'])
- {
- session_start();
- $_SESSION['id'] = $row['id'];
- header("location:index.php");
- }
- else{
- echo "<script>alert('Please check your username and password!'); window.location='login.php'</script>";
- }
- }
- Database::disconnect();
- ?>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement