Monk3h Posted July 29, 2009 Share Posted July 29, 2009 I am trying to create a script to alow users to use multiple layouts on my site and i have hit an error. =/# Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/monk3h/public_html/portfolio/header.php on line 8 The script is all below, line 8 is line 8 in the script. <?php $default_layout = “01”;if (!$HTTP_COOKIE_VARS[‘layout’]) { $include_layout = $default_layout; } else { $include_layout = $HTTP_COOKIE_VARS[‘layout’]; } if (!file_exists(“./header”.$include_layout.”.php”)) { echo “Could not include header”; } else { include_once (“./header”.$include_layout.”.php”); } ?> Link to comment https://forums.phpfreaks.com/topic/168002-solved-include-help/ Share on other sites More sharing options...
TeNDoLLA Posted July 29, 2009 Share Posted July 29, 2009 I really donät know why you use such a weird characters for strings.. try using single or double quotes everywhere instead. <?php $default_layout = '01';if (!$HTTP_COOKIE_VARS['layout']) { $include_layout = $default_layout; } else { $include_layout = $HTTP_COOKIE_VARS['layout']; } if (!file_exists('./header'.$include_layout.'.php')) { echo 'Could not include header'; } else { include_once ('./header'.$include_layout.'.php'); } ?> Edit: as you can see already from this forum, the highlighting shows how much is wrong in your code by using these... don't know what they are called. Link to comment https://forums.phpfreaks.com/topic/168002-solved-include-help/#findComment-886097 Share on other sites More sharing options...
Monk3h Posted July 29, 2009 Author Share Posted July 29, 2009 Thankyou! Works now, i thought they were double qoutes. o.O Link to comment https://forums.phpfreaks.com/topic/168002-solved-include-help/#findComment-886101 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.