Advertisement
Guest User

the other part

a guest
Apr 21st, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function() {
  7. $('#loginform').submit(function(e) {
  8. e.preventDefault();
  9. $.ajax({
  10. type: "POST",
  11. url: 'loginFinal.php',
  12. data: $(this).serialize(),
  13. success: function(data) {
  14. if (data === 'CORRECTO') {
  15. window.location = 'index.php';
  16. }
  17. else {
  18. alert('Invalid credentials');
  19. }
  20. }
  21. });
  22. });
  23. });
  24.  
  25. </script>
  26.  
  27. </head>
  28. <body>
  29. <form id="loginform" method="post">
  30. Username: <input type="text" name="username" id="username" value="">
  31.  
  32. Password: <input type="password" name="password" id="password" value="">
  33.  
  34. <input type="submit" name="loginsub" id="loginsub" value="Login">
  35. </form>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement