Advertisement
Guest User

Untitled

a guest
Apr 9th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <?php
  4.         #create a new session for the user
  5.         session_start();
  6.         #makes sure only one user is created per session
  7.         require_once("class.user.php");
  8.         #create a new USER instance
  9.         $login = new USER();
  10.  
  11.         if($login->is_logged()!=""){
  12.             $login->redirect('index.php');
  13.         }
  14.  
  15.         if(isset($_POST['btn-login'])){
  16.             #remove any and all tags the text inputs may have.
  17.             $username = strip_tags($_POST['uname']);
  18.             $email    = strip_tags($_POST['uname']);
  19.             $password = strip_tags($_POST['password'];
  20.  
  21.             if($login->login($username, $email, $password)){
  22.                 $login->redirect('home.php');
  23.             }else{
  24.                 $error = "Sorry! Wrong Credientials!";
  25.             }
  26.         }
  27.     ?>
  28.  
  29.     <?php include 'head.inc.php' ; ?>
  30.     <?php include 'menu.inc.php' ; ?>
  31.  
  32.  
  33.     <!--HEADER-->
  34.     <header class='register-header'>
  35.             <h2>Login</h2>
  36.             <h3>Already a registered user? Sign in now!</h3>
  37.     </header>
  38.  
  39.     <!--BODY-->
  40.  
  41.     <body class="register-container">
  42.  
  43.         <form name="ContactForm" class="register-grid" action="login.php">
  44.  
  45.              <div class="user-name">
  46.              <p>
  47.              Username: <input type="text" name="uname" onclick="reset_msg();" placeholder="JB007"><br>
  48.              </p>
  49.              <div id="uname_msg"></div>
  50.              <p>
  51.              Password: <input type="password" name="pwd" onclick="reset_msg();" placeholder="password"><br>
  52.              </p>
  53.              <div id="pwd_msg"></div>
  54.              <div class="submit-container">
  55.                 <p><input type="submit" name="btn-login" value="Login" ></p>
  56.              </div>
  57.             </div>
  58.  
  59.         </form>
  60.     </body>
  61.  
  62.     <!--FOOTER-->
  63.  
  64.     <footer>
  65.         <p> Author: Ratna Emani</p>
  66.         <p> Date Created: 3/02/2018 </p>
  67.     </footer>
  68.  
  69. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement