Maybe a better explanation would help. I don't think it is the code that's incorrect.
This is the index.php
Code:
<?php
if ($stylecookie == "") {
$style="default";
}
else {
$style=$stylecookie;
}
Header ("Location: http://localhost/new moray/template.php?page=home&style=$style");
?>
This is template.php and the highlighted code works
Code:
<?php
setcookie ("stylecookie", $style, time()+40000000);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Untitled</title>
<?php echo "<style type=\"text/css\" media=\"all\">@import \"$style.css\";> </style>"; ?>
<?php echo "<link rel=\"alternate style sheet\" type=\"text/css\" href=\"print.css\" title=\"Printable\" />"; ?>
<?php echo "<link rel=\"alternate style sheet\" type=\"text/css\" href=\"default.css\" title=\"Default\" />"; ?>
</head>
<body>
<div class="body">
<?php include ("$page.html"); ?>
</div>
<div class="menu">
<?php include ("menu.php"); ?>
</div>
</body>
</html>
This is what I get in my browser with the highlighted code being the menu.php
Code:
Warning: include(.html) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\new moray\template.php on line 16
Warning: include() [function.include]: Failed opening '.html' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\new moray\template.php on line 16
Home
Picasso
Babeuf
. . . . . . . .
Printable version
Default version
I think somewhere in my Apache httpd.conf or php.ini or another file there is something I need to add for the files with the $ sign in front of them to run.
Bookmarks