Guest User

Untitled

a guest
Jan 7th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. include_once 'indepen_functions.php';
  3.  
  4. sec_session_start(); // Our custom secure way of starting a PHP session.
  5.  
  6. if (isset($_POST['username'], $_POST['password'])) {
  7. $username = $_POST['username'];
  8. $password = $_POST['password']; // The hashed password.
  9.  
  10. if (login($username, $password) == true) {
  11. // Login success
  12. header('Location: ../index.php');
  13. exit();
  14. } else {
  15. // Login failed
  16. echo '{ "message": "Voer het wachtwoord en gebruikersnaam opnieuw in" }';
  17. }
  18. } else {
  19. // The correct POST variables were not sent to this page.
  20. echo 'Invalid Request';
  21. }
  22.  
  23. $('.login-form').validate({
  24. //other code..
  25. submitHandler: function (form) {
  26. form.ajaxSubmit();
  27. return false;
  28. }
  29.  
  30. header('Location: /index.php');
  31. echo 'This page has moved to <a href="../index.php">here</a>';
  32. exit(0);
  33.  
  34. $(".login-form").validate({
  35. success: function(label) { alert('Success'); },
  36. submitHandler: function() { alert('Submit'); }
  37. });
  38.  
  39. window.location = 'your page path';
Add Comment
Please, Sign In to add comment