Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

Re: how do I get the user id of a token?

$
0
0
by Dual Cube.  

Dear Dang,

Hope you are doing good. I understand you are a beginner, and there is no end to the number of problems you may have to face in the initial stages of getting acquainted with Moodle. Don’t worry you will get a hang of it in sometime.

Dang, may I know what exactly you mean by "mobile app"?

To get the details of a logged in user, use the global variable $USER. Define global $USER; in the page where you want to get the user details and then view the full user details by print_r($USER);

To get the user id, you may do this,

$userId = $USER->id;

Do let me know if this helps.

All the best!  Would love to hear from you again.

Purnendu (developer)

DualCube


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>