Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("#login-submit").click(function() {
- var username = $("#username").val().trim();
- var password = $("#password").val().trim();
- if (username != "" && password != "") {
- $.ajax({
- url: 'ajax_login.php',
- type: 'post',
- data: {
- username: username,
- password: password
- },
- success: function(response) {
- var msg = "";
- if (response == 1) {
- $("#login-submit").text("Login");
- $("#login-form").fadeOut("slow");
- window.location = "dashboard.php";
- } else {
- msg = "Invalid username and password!";
- }
- $("#message").html(msg);
- }
- } );
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement