Can anyone help me find out where the user id of the currently logged in user is stored, so that I can access it for use in php?

Thanks.

Pat

Comments

dadderley’s picture

This will get the user id from a node or block.

<?php
global $user; //declare the global user object
echo $user->uid;
?>

This will get the user id and user name and print it as a link to their account page.

<?php
global $user; //declare the global user object
print l($user->name,'user/'.$user->uid);
?>
smalltoto’s picture

i was wondering where is my id

thanx for post and replys