Guest User

Untitled

a guest
Jul 17th, 2018
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('./config.inc.php');
  4. require_once('./lib/db.php');
  5. require_once('./lib/login.php');
  6.  
  7. try {
  8. $db = new DB;
  9. $login = new Login($db);
  10. /* Check if the form has been submitted. If not, redirect to login page */
  11. if(!isset($_POST['submit'])) {
  12. header("Location: index.php");
  13. exit;
  14. } else {
  15. $username = $_POST['username'];
  16. $password = $_POST['password'];
  17. /* Verify the login details are correct and redirect to secure.php */
  18. $login->verifyLogin($username, $password);
  19. }
  20. }
  21.  
  22. catch(Exception $error) {
  23. print $error->getMessage();
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment