squiblo Posted August 16, 2009 Share Posted August 16, 2009 ok i have this working code... <?php if($_SESSION['myusername']){ ?> yes <?php } else { ?> no <?php } ?> and i am trying to change it slightly but nothing is working for me this is what i have.. <?php if($_SESSION['myusername']) { echo ucwords(strtolower($_SESSION['myusername'])); } else { echo "Sign in / Register"; } ?> the problem there is, it always echos "Sign in / Register" if when i log in and when i am not logged in Quote Link to comment https://forums.phpfreaks.com/topic/170462-solved-if-statement/ Share on other sites More sharing options...
squiblo Posted August 16, 2009 Author Share Posted August 16, 2009 sorry silly mistake Quote Link to comment https://forums.phpfreaks.com/topic/170462-solved-if-statement/#findComment-899194 Share on other sites More sharing options...
smerny Posted August 16, 2009 Share Posted August 16, 2009 try using if(isset($_SESSION['myusername'])) Quote Link to comment https://forums.phpfreaks.com/topic/170462-solved-if-statement/#findComment-899195 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.