Welcome to WebmasterWorld Guest from 54.158.65.139

Forum Moderators: coopster & jatar k

how to display logged in username on a page

   
5:55 pm on May 2, 2007 (gmt 0)

5+ Year Member



lets say that i want to show on my exclusive page "hello,_________"you are now logged in.
I have been serching but so far no luck, maybe the answer is simple, I have no idea.I have the sessions variable up already but that small piece of code is missing to complete the page.
thanks again! This is a great forum.
5:59 pm on May 2, 2007 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld fatthumb,

usually when the user logs in the username is put into a session or cookie, the username can then be echo'ed from there

6:25 pm on May 2, 2007 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Yes, session or cookie. We have a thread in our library that shows how the session is set after a successful login, and how you could use it on other pages: [webmasterworld.com...]
1:16 am on May 6, 2007 (gmt 0)

10+ Year Member



Hello fatthumb,

I use this ...
<?php
session_start();
$_SESSION['last_url'] = $_SERVER['REQUEST_URI'];
?>
<html>
<head>
</head>
<body>
<?php
$usr = $_SERVER['PHP_AUTH_USER'];
echo "Hello " . $usr;
?>

Kirk

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month