Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 'On');
- error_reporting(E_ALL | E_STRICT);
- session_start();
- ?>
- <html>
- <head>
- <title>Admin Control Panel</title>
- <link rel="stylesheet" href="style.css"/>
- </head>
- <body>
- <?php
- include('../include/mysql_config.php');
- $error = 'Could not connect to database; either the table is missing, ' .
- 'or mySQL is offline.';
- mysql_connect('localhost', $sql_user, $sql_password);
- @mysql_select_db($sql_database) or die ($error);
- $query = mysql_query('SELECT * FROM site_admin');
- if ($query = false) {
- print $error;
- } else {
- if (($_SESSION['valid_username']) && ($_SESSION['valid_password'])) {
- $checklogin = mysql_query('SELECT * FROM site_admin' .
- "WHERE 'admin_username'=" . $_POST['username'] . " " .
- "AND 'admin_password'=" . $_POST['password']);
- if ($checklogin) {
- echo 'Signed in.';
- }
- } else {
- ?>
- <div class='title'>AdminCP</div><p>
- <div class='login'>
- Please sign in.
- <form action="login.php" method="post">
- Username: <input type="text" name="username" maxlength="15"></br>
- Password: <input type="password" name="password" maxlength="15"></br>
- <input type="submit" value="Submit">
- </form>
- </div>
- <?php
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement