0

Hi please help, im new at this stuff!!

I cant find the error here!!

I have the following error on the top of my website:

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\ITAffair\templates\md-corporate\index.php on line 15

The first couple of lines of code in my index.php file look like this'

<?php

#
#
#
#
# 
#
#

defined( '_JEXEC' ) or die( 'Restricted access' );
$LeftMenuOn = ($this->countModules('position-4') or $this->countModules('position-5') or $this->countModules('position-7'));
$RightMenuOn = ($this->countModules('position-6') or $this->countModules('position-8'));
$TopNavOn = ($this->countModules('position-13'));
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename');
$logopath = $this->baseurl . '/templates/' . $this->template . '/images/logo.png';
$logo = $this->params->get('logo', $logopath);
$logoimage = $this->params->get('logoimage');
$sitetitle = $this->params->get('sitetitle');
$sitedescription = $this->params->get('sitedescription');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template.css" type="text/css" />

        <!-- Contents -->
        <?php if($LeftMenuOn AND $RightMenuOn): ?>
        <div id="content-w1">
        <?php elseif($LeftMenuOn OR $RightMenuOn): ?>
        <div id="content-w2">    
        <?php else: ?>
        <div id="content-w3">    
        <?php endif; ?>
            <jdoc:include type="message" />
            <jdoc:include type="component" />
        </div>

    </div>
    </div>

Edited by corne.henning.12: to much code

4
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by captivatewebs
0

how is your error_reporting set in your xampp php.ini file??

sample error reporting on php.ini file . NOtE! error_reporting = E_ALL ^ E_STRIC has been deprecated some time ago and the E_ALL is the one takes the helm from php 5.4

error_reporting = E_ALL

for the php page, you can also add this on top of the page. If you find editing php.ini file is not within the scope or your espertise, then it can be defined on top of the page before anything else.

 error_reporting(E_ALL);

For more info. on error reporting settings and options, please visit php.net.

0

$conf =& JFactory::getConfig();

This assign by reference is a (pre) PHP4 construct. In PHP5 the default assignment is by reference. If you remove the ampersand, your code would still work, but the warning would be gone.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.