By pyotr777 on
How can I get current user name from PHP script in a module?
I need to perform some user name dependent operations, like creating a directory with user name.
How can I get current user name from PHP script in a module?
I need to perform some user name dependent operations, like creating a directory with user name.
Comments
This should help
First there are two pieces of information that identify a user, their user id (uid) and user name (name). Of the two, uid id unchanging and is the one I would recommend when constructing information that you need to be able to recreate. If you use user name and they change it, the directory effectly no longer exists since it under the old name. In either case here is how you get the information for the current user.
Thank you very much! That's
Thank you very much! That's just what I needed!
How to get profile field and values then?
Thank a lot nevets!
I created two fields via the profile module: profile_my_account and profile_my_password.
But I dont know how to get the value of these fields when I create a page with php code?
Thanks in advance!
eh...
Hehhh, got it done:
i try to use and no result
iam create chat based on drupal system and i want to get the current user id or name which logged in drupal , i try to use it code
and no result i use this code in page in chat folder but no result, waht ic an do ??
thx