0

用户登录我的网站后,我想将用户名存储在会话变量中,以便我可以根据登录的用户在另一个动态页面中使用该信息,

我该如何做到这一点。

4

1 回答 1

0

If your users are logging into Joomla and you need the username in a Joomla file such as a template file you can do the following:

$user = $JFactory::getUser();
if (!$user->guest) {
    $username = $user->username;
}

if (!empty($username)) {
    echo $username;
}
于 2013-01-14T09:00:10.803 回答