1
pessi
SESSION variable
  • 2005/1/7 19:09

  • pessi

  • Quite a regular

  • Posts: 204

  • Since: 2004/5/16


hi

When a user logs on i presume a random session variable is created. Can i acesses this session variable in any php file that I am using?

If yes then what is the variable name for the session variable? if possible also tell me what the variable name for user id is!

$xoops_session and xoops_user by default?

Cheers,
prasad..

2
Mithrandir
Re: SESSION variable

You can use the current user's id through $xoopsUser->getVar('uid')

normally like this:
// Check if visitor is a logged in user
if ($xoopsUser) {
    
// get user's ID
    
$uid $xoopsUser->getVar('uid');
}
else {
    
// set $uid to zero (or don't do anything - up to you)
    
$uid 0;
}

3
pessi
Re: SESSION variable
  • 2005/1/7 19:40

  • pessi

  • Quite a regular

  • Posts: 204

  • Since: 2004/5/16


hi

else i want to direct him to login. Can i do that?

I am a begginer and hope i am not bugging you with simple questions.

Cheers,
prasad..

Login

Who's Online

253 user(s) are online (55 user(s) are browsing Support Forums)


Members: 0


Guests: 253


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits