Welcome to WebmasterWorld Guest from 54.234.8.146

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

logged in as.

     

tr8er8

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

5+ Year Member



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

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

5+ Year Member



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

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

5+ Year Member



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

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

5+ Year Member



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

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

5+ Year Member



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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month