thelexieness Posted April 20, 2010 Share Posted April 20, 2010 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\')); } ?> Link to comment https://forums.phpfreaks.com/topic/199080-i-rather-new-to-phpi-keep-getting-this-syntax-error-unexpected-t_if/ Share on other sites More sharing options...
taquitosensei Posted April 20, 2010 Share Posted April 20, 2010 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. Link to comment https://forums.phpfreaks.com/topic/199080-i-rather-new-to-phpi-keep-getting-this-syntax-error-unexpected-t_if/#findComment-1044933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.