Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Hey,
I would like to have a function, like "Logged in as: BLABLA1"
Also, I would like to see, when i enter credentials and login, Welcome BLABLA1!
Is this a quickfix?
Logged in as
Moderator: mkoch227
Re: Logged in as
Name is stored in the $_SESSION['name'] variable so you would have to paste something like this in the place where you want the name to appear:
If within PHP code:
If within HTML:
If within PHP code:
Code: Select all
echo $_SESSION['name'];
Code: Select all
<?php echo $_SESSION['name']; ?>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 25
- Joined: Tue Oct 12, 2010 3:16 pm
Re: Logged in as
arrigato gozaimasu.
cheers!
My company will donate to you, in 2 weeks or so.
cheers!
My company will donate to you, in 2 weeks or so.
Re: Logged in as
Hi, the following code is what I use for my show_admin_nav.inc.php:
This will show either Good morning $_SESSION['name'], Good afternoon $_SESSION['name'] or Good evening $_SESSION['name'] depending on the time of day 
Hope you find it useful
Code: Select all
<?php
$hour = date("H");
if ($hour < 12)
{
echo "<div align=\"center\">Good morning ";
echo $_SESSION['name'];
echo ".</div>";
}
elseif ($hour < 17)
{
echo "<div align=\"center\">Good afternoon ";
echo $_SESSION['name'];
echo ".</div>";
}
else
{
echo "<div align=\"center\">Good evening ";
echo $_SESSION['name'];
echo ".</div>";
}
?>

Hope you find it useful
