1
jcortego
Using variables NAME and UNAME
  • 2007/2/19 17:02

  • jcortego

  • Just popping in

  • Posts: 16

  • Since: 2003/9/30


I need to pick "uname" and "name" variables up (that come from login), in order to use them in other subroutines.
How do I recover these variables from any other piece of code ?

2
Dave_L
Re: Using variables NAME and UNAME
  • 2007/2/19 19:55

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Example (not tested):

function foo()
{
   global 
$xoopsUser;
   
is_object($xoopsUser) or redirect_header('index.php'3_NOPERM);
   
$uname $xoopsUser->getVar('uname');
   
$name $xoopsUser->getVar('name');
   
var_dump('in foo''uname'$uname'name'$name);
}


Quote:
Joined: 2003/9/30
Posts: 7

3
jcortego
Re: Using variables NAME and UNAME
  • 2007/2/20 11:02

  • jcortego

  • Just popping in

  • Posts: 16

  • Since: 2003/9/30


Thanks, Dave, I'll try it...

Login

Who's Online

353 user(s) are online (222 user(s) are browsing Support Forums)


Members: 0


Guests: 353


more...

Donat-O-Meter

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

Latest GitHub Commits