Advertisement
Guest User

Untitled

a guest
Jun 14th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. include_once PS_ROOT.'/includes/configuration.php';
  3. include_once PS_ROOT.'/includes/connexion.php';
  4. include_once PS_ROOT.'/includes/functions.php';
  5.  
  6. sec_session_start(); // Our custom secure way of starting a PHP session.
  7.  
  8. // Variable with errors/succes
  9. $error_msg = "";
  10. $succes_msg = "";
  11.  
  12. if (isset($_POST['username'], $_POST['password'])) {
  13.  
  14. $username = $_POST['username'];
  15. $password = $_POST['password'];
  16.  
  17. if(login($username, $password, $mysqli))
  18. $succes_msg .= "You are now connected";
  19. } else
  20. $error_msg .= 'Fields are empty';
  21.  
  22. $_SESSION['error'] = $error_msg;
  23. $_SESSION['succes'] = $succes_msg;
  24. unset($error_msg);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement