Jump to content

I rather new to php,i keep getting this: syntax error, unexpected T_IF


thelexieness

Recommended Posts

Hi everyone, i'm completely new to php and i'm at my wits end trying to edit something here, each time i run it i keep getting this error: Parse error: syntax error, unexpected T_IF on line 64.

 

Below is the code, i would be eternally gratefull if someone could help me:

 

<?php

(if ($this->params->get(\'ueberschrift\') == false) {

$ueberschrift = $mainframe->getCfg(\'sitename\');

} else {

$ueberschrift = $this->params->get(\'ueberschrift\');

}

if ($this->params->get(\'copyright\') == false) {

$copyright = date(\'Y\')." ".$mainframe->getCfg(\'sitename\');

} else {

$copyright = date(\'Y\')." ". $this->params->get(\'copyright\');

}

 

$ersetzmich = array("&", "und");

$ersetzmichmit = array("%26", "%26");

 

$ueberschrift = str_replace($ersetzmich, $ersetzmichmit, $ueberschrift);

$copyright = str_replace($ersetzmich, $ersetzmichmit, $copyright);

 

 

if ($this->params->get(\'eigener_farbstring\') == false) {

 

list ($farbe3, $farbe1, $farbe2) = split(\':\', $this->params->get(\'farbe\'));

 

} else {

list ($farbe3, $farbe1, $farbe2) = split(\':\', $this->params->get(\'eigener_farbstring\'));

}

 

?>

this line

(if ($this->params->get(\'ueberschrift\') == false) {

should be closer to this

if ($this->params->get('ueberschrift') == false) {

you don't need to escape the double quotes here and single quotes are preferrable here to parse it as a string, and you had an extra parenthesis at the beginning. You have a lot of escape single and double quotes when you don't need 'em.  If it's a string and you don't need to parse it use single quotes.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.