homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
how to display logged in username on a page
fatthumb




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

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.

 

jatar_k




msg:3328906
 5:59 pm on May 2, 2007 (gmt 0)

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

eelixduppy




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

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...]

calvinmicklefinger




msg:3331893
 1:16 am on May 6, 2007 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved