Jquery PHP - How to handle login callback on same page? -
simply, website allows users 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 proper login. what? use jquery $.show
hidden object, or load new content php page $.get
or $.load
? i'm uneasy on using $.show
because elements loaded dom regardless of proper login. of takes place on same page. of these 2 options better practice? or there another?
using ajax request login not practice. anyway there 3 ways:
- you can add "blank" object dom without first, last names , other dynamic or important information , fill , show user logins.
- send dom object response authrize.php
- do not use ajax login :)
Comments
Post a Comment