Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script>
- $(document).ready(function() {
- $('#loginform').submit(function(e) {
- e.preventDefault();
- $.ajax({
- type: "POST",
- url: 'loginFinal.php',
- data: $(this).serialize(),
- success: function(data) {
- if (data === 'CORRECTO') {
- window.location = 'index.php';
- }
- else {
- alert('Invalid credentials');
- }
- }
- });
- });
- });
- </script>
- </head>
- <body>
- <form id="loginform" method="post">
- Username: <input type="text" name="username" id="username" value="">
- Password: <input type="password" name="password" id="password" value="">
- <input type="submit" name="loginsub" id="loginsub" value="Login">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement