Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Question about variables in PHP Fusion 9

Asked Modified Viewed 1,315 times
O
Oskman
O
Oskman 10
  • Newbie, joined since
  • Contributed 8 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
asked
Newbie

While coding PHP in custom pages in PHP Fusion 7 I used $userdata['user_name']; to get the current user. In PHP Fusion 9 this seems not to be around. So my question is how to get the logged in username now adays.

Thank you in advance!
0 replies

1 post

R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

In v9 you must first declare variable


$userdata = fusion_get_userdata();
echo $userdata['user_name'];

// or
echo fusion_get_userdata('user_name');


And if you need get settings

$settings= fusion_get_settings();
echo $settings['sitename'];

// or
echo fusion_get_settings('sitename');
0 replies

Category Forum

General Discussion

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
O
O
Oskman 10
  • Newbie, joined since
  • Contributed 8 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet