dougou3871 2016-08-02 15:06
浏览 20
已采纳

如何获取phpFox网站的当前用户详细信息?

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.

ob_start();
session_start();

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?

  • 写回答

2条回答 默认 最新

  • douzui0143 2016-08-04 14:58
    关注

    On module, you can use:

    $iUserId = Phpfox::getUserId();
    

    On App, you can use:

    $iUserId = user()->id;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?