Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? session_start(); ?>
- <div align="left"><a href='register.php'>REGISTER <i class="fa fa- user-plus" aria-hidden="true"></i></a>
- <? include('HtmlNavSetupnohome.php');include('sqlDeets.php')
- ?>
- <link href="css/hawthorne_type1_color1.css" rel="stylesheet">
- <link href="css/font-awesome.min.css" rel="stylesheet">
- <form action="" method="POST">
- <h3>USERNAME:</h3><input id="username" type="text" name="username"/>
- <h3>PASSWORD:</h3><input id="password" type="password" name="password"/><br>
- <input class="login" type="submit" name="submit" value="Login" />
- </form>
- <?
- include('connect.php');
- if (isset($_POST['username']) and isset($_POST['password'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "SELECT * FROM user WHERE username='$username' and password='$password'";
- $result = mysql_query($query) or die(mysql_error());
- $count = mysql_num_rows($result);
- if (isset($_POST['submit']))
- {
- if ($count == 1){
- $_SESSION['username'] = $username;
- }else{
- ?>
- <br>INVALID LOGIN DETAILS<br><?
- session_destroy();
- $_SESSION['username'] = null;
- }
- }
- if (isset($_SESSION['username'])){
- ?>
- <script type="text/javascript">location.href = 'http://www.bradleyboothman.co/homepage.php';</script>
- <?
- $_SESSION['username'] = $username;
- }else{
- }
- }
- if (!isset($_SESSION['username'])) {
- // use is not logged in
- } else {
- // user is logged in
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement