Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #create a new session for the user
- session_start();
- #makes sure only one user is created per session
- require_once("class.user.php");
- #create a new USER instance
- $login = new USER();
- if($login->is_logged()!=""){
- $login->redirect('index.php');
- }
- if(isset($_POST['btn-login'])){
- $username = strip_tags($_POST['uname']);
- $email = strip_tags($_POST['uname']);
- $password = strip_tags($_POST['password'];
- if($login->login($username, $email, $password)){
- $login->redirect('home.php');
- }else{
- $error = "Sorry! Wrong Credientials!";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <?php include 'head.inc.php' ; ?>
- <?php include 'menu.inc.php' ; ?>
- <!--HEADER-->
- <header class='register-header'>
- <h2>Login</h2>
- <h3>Already a registered user? Sign in now!</h3>
- </header>
- <!--BODY-->
- <body class="register-container">
- <form name="ContactForm" class="register-grid" action="login.php">
- <div class="user-name">
- <p>
- Username: <input type="text" name="uname" onclick="reset_msg();" placeholder="JB007"><br>
- </p>
- <div id="uname_msg"></div>
- <p>
- Password: <input type="password" name="pwd" onclick="reset_msg();" placeholder="password"><br>
- </p>
- <div id="pwd_msg"></div>
- <div class="submit-container">
- <p><input type="submit" name="btn-login" value="Login" ></p>
- </div>
- </div>
- </form>
- </body>
- <!--FOOTER-->
- <footer>
- <p> Author: Ratna Emani</p>
- <p> Date Created: 3/02/2018 </p>
- </footer>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement