Jump to content

[SOLVED] include help


Monk3h

Recommended Posts

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

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

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.