简体   繁体   中英

Error messege Strict Standards on joomla site

On the top of my joola website I get this error:

Strict Standards: Only variables should be assigned by reference in /home/mysite/public_html/templates/mysite/index.php on line 77

When I look up the index.php file that is referred to above and go to line 77 I see:

$user =& JFactory::getUser();

I think there is something wrong with that code, some how I need to change the:

JFactory::getUser()

to something like:

JFactory->getUser()

That is what I read by google the issue, but I cant figure out the correct code. Can some one advice?

Here is the compleate code section:

  $app    = JFactory::getApplication();
  $menu   = $app->getMenu();
  $active = $menu->getActive();
  $class  = $active->alias . " pageid-" . $active->id;
  $user =& JFactory::getUser();
  $userId = $user->get( 'id' );
  $username = $user->name;

Quick solution: Turn off error messages. Just go to "Global Configuration" in your backend, switch to the server tab and set the error reporting to none. Better solution: if you upgraded your php version, thats because of it. if not, find that extension using this php code and upgrade it. next solution: if you use joomla 1.5 or 2.5 its better to upgrade to newer version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM