Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login_timeout() {
- $("#login-stats > p").html('SEEMS SOMETHING WENT WRONG!<br />Please try again later');
- }
- $(document).ready(function() {
- $("#lbutton").click(function() {$('#login-stats').show('slow');});
- $('#loginform').submit(function() {
- var errors = [];
- var username = $("#username").val();
- var password = $("#password").val();
- if (username == "") {
- errors.push("No username specified<br />");}
- if (password == "") {
- errors.push("No password specified<br />");
- }
- if(errors.length > 0) {
- errors.unshift("<strong>Please check the following errors:</strong> <br />");
- $("#login-stats > p").html(errors.join('* '));
- return false;
- } else {
- $("#login-stats > p").html('<img src="images/logging.gif" width="64" height="64" align="left" /><strong>Please wait...</strong><br /><br />While we verify your username and password');
- var timeout = setTimeout('login_timeout()', 30000)
- $.post('checklogin.php', $("#loginform").serialize(), function(data) {
- if (data.match(/Invalid/i)) {
- errors.push("<strong>Please check the following errors:</strong> <br />");
- errors.push(data);
- $('#login-stats').html(errors.join(''));
- clearTimeout(timeout);
- } else if (data.match('/OK/i')) {window.location = "index.html"; clearTimeout(timeout);}
- });
- }
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement