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 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 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'])) Link to comment https://forums.phpfreaks.com/topic/170462-solved-if-statement/#findComment-899195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.