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.
Sign In
Not a member yet? Click here to register.

Question about variables in PHP Fusion 9


Print Track
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!

1 reply

In v9 you must first declare variable

CodeDownload  

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

// or
echo fusion_get_userdata('user_name');



And if you need get settings
CodeDownload  

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

// or
echo fusion_get_settings('sitename');

author Oskman
forumGeneral Discussion
replies2 posts
viewed353 times
activeLast updated on 9 months ago
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: RobiNN, Oskman