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 Link to comment https://forums.phpfreaks.com/topic/210134-headerlocation-indexphp-with-ajax/ 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 Link to comment https://forums.phpfreaks.com/topic/210134-headerlocation-indexphp-with-ajax/#findComment-1096655 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 Link to comment https://forums.phpfreaks.com/topic/210134-headerlocation-indexphp-with-ajax/#findComment-1096657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.