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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.