Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- session_start();
- require("includes/connection.php");
- if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['username']))
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "SELECT * FROM customer WHERE username='$username' and password='$password'";
- $result = mysqli_query($con,$query) or die(mysqli_error() );
- $count = mysqli_num_rows($result);
- if($count == 1){
- $_SESSION['login_session'] = "OK";
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- header('Location: MainPage007.php');
- }
- else {
- echo "Invalid Username or Password. Please try again.";
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <!-- Defining the character set standard 'UTF-8' -->
- <meta charset="utf-8" />
- <!-- Defining a title for our web-application -->
- <title>007 Memorabilia - Login</title>
- <link rel="stylesheet" type="text/css" href="styleLogin.css" />
- </head>
- <body>
- <div id="wrapper">
- <header>
- <!-- Replace image with a 007 Memorabilia Logo -->
- <img src="007logo.png" alt="007Logo" style=" width:150px;height:auto; ">
- </header>
- <div id="loginform">
- <div id="content">
- <p>Please enter your username and password:</p>
- <form action="Login.php" method="post" name="loginform">
- <table>
- <tr>
- <td align="right">Username: </td>
- <td><input type="text" size="20" maxlength="15" name="username"></td>
- </tr>
- <tr>
- <td align="right">Password: </td>
- <td><input type="Password" size="20" maxlength="15" name="password"></td>
- </tr>
- <tr>
- <td></td>
- <td colspan="2" align="left"><input type="submit" value="Login"></td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- </div>
- <footer>
- <p>By Ashley Coupland</p>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement