Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
- <script>
- $("#login").click(function(){
- $("#slfErrorAlert").hide();
- if($("#username").val().length > 0 && $("#password").val().length > 0){
- $('#login').prop('disabled', true);
- $("#slfErrorAlert").html("Signing in...").show();
- $("#slfErrorAlert2").html("(Please allow up to 60 seconds)").show();
- $.ajax({
- url:"login.php",
- data:{username:$("#username").val(),password:$("#password").val()},
- type:"POST",
- success: function(data){
- if(data == "ok") $("#slfErrorAlert").hide(), window.location = "success.php";
- else $("#slfErrorAlert").hide(), $("#slfErrorAlert2").hide(), $("#slfErrorAlert").html(data).show(), $('#login').prop('disabled', false);
- }
- });
- }
- else {
- $("#slfErrorAlert").html("Please enter your username/password").show();
- }
- return false
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement