Guest User

Untitled

a guest
Mar 30th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $("#login").click(function(){
  2. if($("#username").val().length > 0 && $("#password").val().length > 0){
  3.                     $.ajax({
  4.                 url:"login.php",
  5.                 data:{username:$("#username").val(),password:$("#password").val()},
  6.                 type:"POST",
  7.                 success: function(data){
  8.                 if(data == "ok") window.location = "success.php";
  9.                 else $("#slfErrorAlert").html(data).show();
  10.                 }
  11.                 });
  12. }
  13. else {
  14. $("#slfErrorAlert").html("Username and password is required").show();  
  15. }
  16.     return false
  17.     });
Add Comment
Please, Sign In to add comment