Advertisement
Guest User

11

a guest
Aug 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. require_once 'core/init.php';
  2.  
  3. if(logged_in() === TRUE) {
  4. header('location: dashboard.php');
  5. }
  6.  
  7. // form submiited
  8. if($_POST) {
  9. $username = $_POST['username'];
  10. $password = $_POST['password'];
  11.  
  12. if($username == "") {
  13. echo " * Username Field is Required <br />";
  14. }
  15.  
  16. if($password == "") {
  17. echo " * Password Field is Required <br />";
  18. }
  19.  
  20. if($username && $password) {
  21. if(userExists($username) == TRUE) {
  22. $login = login($username, $password);
  23. if($login) {
  24. $userdata = userdata($username);
  25.  
  26. $_SESSION['id'] = $userdata['id'];
  27.  
  28. header('location: dashboard.php');
  29. exit();
  30.  
  31. } else {
  32. echo "Incorrect username/password combination";
  33. }
  34. } else{
  35. echo "username does not exists";
  36. }
  37. }
  38.  
  39. } // /if
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement