Simply, my website allows users to login.
$('#login').click(function() {
var user = $('#username').val();
var pass = $('#password').val();
$.post('authorize.php', { username: user, password: pass }, function(data) {
//??
});
});
authorize.php verifies credentials assuring a proper login. But now what? Do I use Jquery to $.show a hidden object, or do I load the new content from a PHP page with $.get or $.load? I’m uneasy on using $.show because elements will be loaded into the DOM regardless of a proper login. All of this takes place on the same page. Which of these two options is better practice? Or is there another?
Using ajax request for login it is not good practice. Anyway there are three ways:
other dynamic or important information and fill it and show as soon as user
logins.