riddleywalker Posted May 18, 2010 Share Posted May 18, 2010 I had the bright idea of a login div at the top of the page that would dynamically change depending on where a person was in the login process: Logged in, it would show the user and have a logout button. Not logged in...it would display the standard username/password/forgot password items. I thought I would use Ajax to swap the contents of the div with the appropriate info, but that doesn't degrade nicely if the user is not using javascript. Has anyone done this sort of thing? Have a sample or point me in the right direction? thanks. Link to comment https://forums.phpfreaks.com/topic/202191-ajaxphpjavascriptlogin-help/ Share on other sites More sharing options...
gwolgamott Posted May 18, 2010 Share Posted May 18, 2010 Just make it part of the script of the page. A simple if / else statement should be all you need. if(isset($username)) { //Do not logged in display } else { //Do logged in display } Link to comment https://forums.phpfreaks.com/topic/202191-ajaxphpjavascriptlogin-help/#findComment-1060236 Share on other sites More sharing options...
sharp.mac Posted May 19, 2010 Share Posted May 19, 2010 Dover over complicate yourself with ajax right now. If your just wanting a if statement that checks login gwolgamott's is it. Since the user has to submit user name and password for validation dont worry about ajax since the page is already needing to reload just run the php if statement to change the html output. Link to comment https://forums.phpfreaks.com/topic/202191-ajaxphpjavascriptlogin-help/#findComment-1060351 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.