Welcome to WebmasterWorld Guest from 54.224.103.186

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

logged in as.

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

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts: 94
votes: 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?
1:10 am on Feb 29, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 30, 2006
posts:84
votes: 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]

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

Full Member

5+ Year Member

joined:June 1, 2007
posts:201
votes: 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

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

Junior Member

5+ Year Member

joined:Feb 6, 2008
posts: 94
votes: 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 :/
8:39 am on Feb 29, 2008 (gmt 0)

Full Member

5+ Year Member

joined:June 1, 2007
posts:201
votes: 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