homepage Welcome to WebmasterWorld Guest from 184.72.82.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

PHP Server Side Scripting Forum

    
logged in as.
tr8er8




msg:3587639
 12:33 am on Feb 29, 2008 (gmt 0)

I have a script where users can register/login. Except I'm not sure how to show "Logged in as: {username}". How would I do that?

 

Vis3R




msg:3587670
 1:10 am on Feb 29, 2008 (gmt 0)

you can find the username either in $_SESSION or $_COOKIE or someplaces like this probably.. do a var_dump on these variables and see what you get out

[edited by: Vis3R at 1:13 am (utc) on Feb. 29, 2008]

bkeep




msg:3587741
 3:20 am on Feb 29, 2008 (gmt 0)

Are you using Smarty templates or strait php?

if it is Smarty there will be a $smarty->assign("username",isvalue);
statement somewhere in whichever page calls the tpl file.

Otherwise as Vis3R said look for $_SESSION['user'] or something to that effect.

Best Regards,
Brandon

tr8er8




msg:3587769
 4:31 am on Feb 29, 2008 (gmt 0)

Ok I got that to work, but now how do I make it so I can make a page, that ONLY the user logged in can edit. Like their own control panel? I cant seem to get this to work :/

bkeep




msg:3587844
 8:39 am on Feb 29, 2008 (gmt 0)

Well that is kind of a tough question to answer without any example code. Is this something you are writing or is it a script you downloaded from somewhere? You should give a detailed explanation with code examples of what you have tried and what hasn't work sort of thing.

Best Regards,
Brandon

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved