Advertisement
Guest User

Untitled

a guest
Feb 21st, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2. //include config
  3. require_once('includes/config.php');
  4.  
  5. //check if already logged in move to home page
  6. if( $user->is_logged_in() ){ header('Location: index.php'); }
  7.  
  8. //process login form if submitted
  9. if(isset($_POST['submit'])){
  10.  
  11. $username = $_POST['username'];
  12. $password = $_POST['password'];
  13.  
  14. if($user->login($username,$password)){
  15. $_SESSION['username'] = $username;
  16. header('Location: memberpage.php');
  17. exit;
  18.  
  19. } else {
  20. $error[] = '<div class="error"><p>Wrong username or password or your account has not been activated.</p></div>';
  21. }
  22.  
  23. }//end if submit
  24.  
  25. //define page title
  26. $title = 'Login';
  27.  
  28. //include header template
  29. require('layout/header.php');
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement