Jump to content

Show Currentuser


CJLeah

Recommended Posts

the session is saved, but it's not straight after login, even though your logged in to see it, its more of like, a paragraph of text then sayng they user name.....but I have no idea to get the users name to appear...:(


eg:

Yo .currentuser. how are you today, please submit the scriptcheck before proceeding..
Link to comment
https://forums.phpfreaks.com/topic/7763-show-currentuser/#findComment-28310
Share on other sites

[!--quoteo(post=366152:date=Apr 18 2006, 09:05 PM:name=Chris Leah)--][div class=\'quotetop\']QUOTE(Chris Leah @ Apr 18 2006, 09:05 PM) [snapback]366152[/snapback][/div][div class=\'quotemain\'][!--quotec--]
the session is saved, but it's not straight after login, even though your logged in to see it, its more of like, a paragraph of text then sayng they user name.....but I have no idea to get the users name to appear...:(
eg:

Yo .currentuser. how are you today, please submit the scriptcheck before proceeding..
[/quote]

I was also trying to display the username, i'm using this once, they're logged in, just rip the username strate out of the session variable...


<?php if ($_SESSION['MM_Username'] != NULL) {
?>
Welcome,<?php echo " ".$_SESSION['MM_Username']; ?>

basically, the username is stored in a session variable, so you test to see if they're logged in (as when they're not logged in, the session variable is NULL. If they are logged in, then you display "Welcome <user>".

There is a bit more to the code, which if the user is not logged in, it display's a login form. But hopefully that bit will get it working for you!
Link to comment
https://forums.phpfreaks.com/topic/7763-show-currentuser/#findComment-28406
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.