Malcolmhire2001 Posted May 23, 2006 Share Posted May 23, 2006 hello i would like to create a duynamic Login/Logout link at the top of all my pagesso if the user is not logged in it displays a login link but if the user is logged in it displays a logout linkdoes anyone know how i would go about this?thanks, Malcolm Quote Link to comment https://forums.phpfreaks.com/topic/10263-dynamic-loginlogout-link/ Share on other sites More sharing options...
zq29 Posted May 23, 2006 Share Posted May 23, 2006 Just a simple if/else should do the trick:[code]<?phpif(isset($_SESSION['username'])) { echo "Logout";} else { echo "Login";}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10263-dynamic-loginlogout-link/#findComment-38230 Share on other sites More sharing options...
Malcolmhire2001 Posted May 23, 2006 Author Share Posted May 23, 2006 thanks thats worked greatcheers Quote Link to comment https://forums.phpfreaks.com/topic/10263-dynamic-loginlogout-link/#findComment-38234 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.