Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 04:35 am EST

Geeklog Forums

Currently Logged In User Info ?


Status: offline

donaldp

Forum User
Newbie
Registered: 05/15/06
Posts: 2
Hi all,

Maybe I didn't search deep enough or with the right leywords, but I can't seem to find a solution for this.

I simply need to find about what is the current user's UID and his email address from a simple PHP script pasted in a Static Page plugin. I tried $_USER[...] but it's always empty.

Maybe a global setting that needs to be changed to allow this ?

We're using GL v1.3.11sr5.

thanks
Donald
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You were on the right track - the $_USER array has that information. Please note that you have to declare it as being global before you can use it.

Another thing to watch out for: For an anonymous user, $_USER['uid'] may not be set.

bye, Dirk
 Quote

Status: offline

donaldp

Forum User
Newbie
Registered: 05/15/06
Posts: 2
Indeed, I was missing the global $_USER; line.

It works now. Very Happy

Thanks for the quick reply!

Donald
 Quote

All times are EST. The time is now 04:35 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content