Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. include_once("functions.inc.php");
  3.  
  4. // get user and password from POST
  5. if (!empty($_POST)) {
  6. $username = $_POST['email'];
  7. $password = $_POST['password'];
  8.  
  9. // check if user can login
  10. if ( canIlogin($username, $password)) {
  11. // remember that the user has logged in (cookies)
  12. setcookie("login", $username, time());
  13.  
  14. // if ok -> redirect naar index.php
  15. header('Location: index.php');
  16. }
  17. else {
  18. $error = "Login failed";
  19. }
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement