function check_availability(){
//get the username
var username = $('#rUsername').val();
//use ajax to run the check
$.post("./users/php/site/user/check", { username: username },
function(result){
if(result == 1){
$('#username_availability_result').html('<span style="color:green">Username: <b>' + username + '</b> is available!</span>');
}
else
{
$('#username_availability_result').html('<span style="color:red">Username: <b>' + username + '</b> is taken!</span>');
}
});
}
From what its seen, Looks like a Habbo staff page where it checks if the staff member is online or not, If yes the status bar goes green and if not, turns red.Code:function check_availability(){ //get the username var username = $('#rUsername').val(); //use ajax to run the check $.post("./users/php/site/user/check", { username: username }, function(result){ if(result == 1){ $('#username_availability_result').html('<span style="color:green">Username: <b>' + username + '</b> is available!</span>'); } else { $('#username_availability_result').html('<span style="color:red">Username: <b>' + username + '</b> is taken!</span>'); } }); }
that is my script It check /users/php/site/user/check/index.php and runs to see if its available.
SELECT users.username FROM users where users.online = 1;