GetSimple Support Forum
How do I access user data? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: How do I access user data? (/showthread.php?tid=9579)



How do I access user data? - cobber - 2017-04-06

Been searching for hours and still can't see how to access user data like username etc.

Wanted to get the user name of logged in user and write that to another file just for testing purposes

Any ideas please?


RE: How do I access user data? - Carlos - 2017-04-07

You can use global $USR
Code:
<?php

if ($USR) {
  echo 'Current user: ',$USR;
}

?>



RE: How do I access user data? - cobber - 2017-04-07

(2017-04-07, 00:37:35)Carlos Wrote: You can use global $USR
Code:
<?php

if ($USR) {
 echo 'Current user: ',$USR;
}

?>

Thanks Carols, I ended up using the
PHP Code:
get_cookie('GS_ADMIN_USERNAME'); 
but i suppose I could use USR too.