Andrew Aubury Andrew Aubury - 1 year ago 478
PHP Question

How do I get the current user details for a phpFox website?

I am creating a webcam system to go on my phpFox site and am attempting to get the current user's ID. I've tried the following, but to no avail.


function get_user_id() {
$userid = null;
$id = Phpfox::getUserBy('user_id');
if (!empty($id)) {
$userid = $id;
return $userid;

$idd = get_user_id();

echo("User ID: " . $idd);

How would I get the user ID of the current user?

Answer Source

In phpFox, you can get the current user ID with the following function:

$iUserId = Phpfox::getUserId();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download