Eggzorcist Posted August 8, 2010 Share Posted August 8, 2010 I'm using jQuery ajax for my login script. However my linked php file with ajax doesn't change the screen with header('location') whats a way to change the page on login using ajax? Thanks Quote Link to comment Share on other sites More sharing options...
dooper3 Posted August 8, 2010 Share Posted August 8, 2010 The problem with doing this with the PHP script that you're making this ajax request to is that it's redirecting the ajax request, not the browser itself. You either need to perform the redirect with javascript after the ajax request by putting the following in the ajax callback: location.href = 'index.php'; Providing they've logged in correctly and you could do a different one if the login failed. Hope that helps Quote Link to comment Share on other sites More sharing options...
Eggzorcist Posted August 8, 2010 Author Share Posted August 8, 2010 However, I'm not quite sure how to detect a return to the ajax. How can I make it detect whether its a true or false login? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.