We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
General
General Support
Search
[self-solved]How to get the user ID from a php script ?
156 Posts
French Fries
Reply #1,
17 years, 7 months ago
Hello, how do I just get the user id from php script called in my page ?
I tried $username...
EDIT : ok I think i got it :
$uid = $modx->getLoginUserID(); $userid=$uid[0];
171 Posts
etal
Reply #2,
17 years, 7 months ago
I assume by php script you mean a snippet. Should be
$modx->getLoginUserID()
According to the api pages
156 Posts
French Fries
Reply #3,
17 years, 7 months ago
Thanks for your answer, I’m not so newbie with modx but I’ve never tried to do this.