thelee Posted November 10, 2012 Share Posted November 10, 2012 hello.im creating a website.i want to show the user name after they logged in and for those who dont register i want to leave any msg. when the user login it will show welcome "the user name" but when the user dont log in,it will be a error, can someone help me. here is the code <?php session_start(); echo "Welcome ".$_SESSION['MM_Username']; else (isset($_SESSION['MM_Username'])) { echo "why you dont register?"; } ?> Link to comment https://forums.phpfreaks.com/topic/270525-display-users-name-after-login-php/ Share on other sites More sharing options...
MDCode Posted November 10, 2012 Share Posted November 10, 2012 It's hard to follow your explanation. I assume you have already set the $_SESSION variables so just do: <?php session_start(); if(isset($_SESSION['MM_Username'])) { echo "Welcome ".$_SESSION['MM_Username'].""; } else { echo "why you dont register?"; } ?> Link to comment https://forums.phpfreaks.com/topic/270525-display-users-name-after-login-php/#findComment-1391425 Share on other sites More sharing options...
thelee Posted November 10, 2012 Author Share Posted November 10, 2012 case solved ! thanks to social cloud ! love u muah Link to comment https://forums.phpfreaks.com/topic/270525-display-users-name-after-login-php/#findComment-1391427 Share on other sites More sharing options...
MDCode Posted November 10, 2012 Share Posted November 10, 2012 Don't forget to mark the topic as solved Link to comment https://forums.phpfreaks.com/topic/270525-display-users-name-after-login-php/#findComment-1391435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.