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 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] 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 Link to comment https://forums.phpfreaks.com/topic/10263-dynamic-loginlogout-link/#findComment-38234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.