I am using PHP and jQuery to validate a login. If the user enters wrong user/pass, an error message will be shown on the index.php page, under a <DIV></DIV> tag. This works fine...
But, how do I make an index.php page redirect to welcome.php once the user enters the correct login information? Since everything is handled by jQuery, hence using the header("location: welcome.php") function will not work as the page is NOT refreshing.
Since you are using ajax for login, I think replacing the login form and other related stuffs with a welcome message would be more elegant than a redirection. Though you could execute a simple javascript snippet like
Code:
window.location="welcome.php";
PS: Make sure that you are using a progressive enhancement methodology, otherwise your site would result serious accessibility issues.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)