$("#login").click(function(){
$.getJSON("handlers/Login.php?name="+$("#username").val(), function(data){
console.log(data); //get whatever i have in login box and sends to my handler returning the json array
});
template = $("#hidebody");
if(!data['error']){
template.show();
//$("#greeting")
}
else
{
template.hide();
}
return false;
});
So far the top part works, which means whatever name i type in username box it is send to my handler login.php, when i do a console.log, and so on console i get my json array back from my database which works, now I need some help writing a if and else statment where the comment box appears after the person logs in, which hides the userbox, and password box, and as a greet statment displaying the person name from the database.