colap Posted November 4, 2009 Share Posted November 4, 2009 For example: this phpfreaks forum, If i login the login textboxes are gone and from navigation menu we have logout and other extra menus. How would i do this? Do i have to load whole new page or do i have to use Ajax to implement this? Quote Link to comment https://forums.phpfreaks.com/topic/180216-changing-the-login-logout-division/ Share on other sites More sharing options...
Russia Posted November 4, 2009 Share Posted November 4, 2009 I would add if statements, like if someone is logged in with the session username, then echo this, if the person is logged out or not logged in then echo something else like a register or login link. Quote Link to comment https://forums.phpfreaks.com/topic/180216-changing-the-login-logout-division/#findComment-950677 Share on other sites More sharing options...
colap Posted November 4, 2009 Author Share Posted November 4, 2009 I would add if statements, like if someone is logged in with the session username, then echo this, if the person is logged out or not logged in then echo something else like a register or login link. Do you mean a new page will be loaded with new "echo <a href="" >..." if someone is logged in other nothing will happen. Is it? Quote Link to comment https://forums.phpfreaks.com/topic/180216-changing-the-login-logout-division/#findComment-950700 Share on other sites More sharing options...
xtopolis Posted November 4, 2009 Share Posted November 4, 2009 session_start(); if( $_SESSION['hasLoggedIn'] == 1 ) { echo 'Hello ' . $_SESSION['username']; }else{ echo 'Please login'; //login form } Quote Link to comment https://forums.phpfreaks.com/topic/180216-changing-the-login-logout-division/#findComment-950740 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.