Use of undefined constant
min side virker på localhost, samt på min egen www linux server, men på vores eksamens server før jeg følgende fejl:Notice: Use of undefined constant about - assumed 'about' in D:\Users\EAMV201015\index.php on line 42>Om søndergård
Notice: Use of undefined constant home - assumed 'home' in D:\Users\EAMV201015\include\function.php on line 78
om mange flere ligende:
linje 42 min index ser sådan her ud:
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=about"<?php if($table==about) { ?> style="text-decoration:underline" <?php } ?>>Om søndergård</a></li>
hvad gør jeg forkert? nedenfor er mere udspecificeret kode.
Min index.php
<?php
// Denne funktion gør at teksten bliver pakke så meget sammen som muligt
function callback($buffer)
{
$holdit=$buffer;
$strip1 = array(" ","\n","\r");
$strip2 = array(" ","","");
$holdit=str_replace($strip1,$strip2, $holdit);
return $holdit;
}
header("Content-language: da");
header("Cache-Control: public");
header("Pragma: public");
header("Expires: Thu, 20 Aug 2065 23:59:59 GMT");
// gzipper sitet
ob_start("ob_gzhandler");
// køre funktionen callback
ob_start("callback");
//inkludere filen function.php
include('./include/function.php');
// XML
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da">
<head>
<link rel="stylesheet" href="include/style.css" type="text/css" media="all" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Børnehaven Søndergård</title>
</head>
<body>
<!-- boksen som rummer sitet -->
<div id="container">
<a href="<?php $_SERVER['PHP_SELF'];?>?table=home"><img src="images/logo.png" id="logo" width="123" height="92" alt="Logo" /></a>
<!-- øverste boks som indeholder hovedmenu -->
<div id="headernavi">
<!-- horisontal UL til hovedmenu punkterne -->
<ul id="headernavilist">
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=about"<?php if($table==about) { ?> style="text-decoration:underline" <?php } ?>>Om søndergård</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=everyday"<?php if($table==everyday) { ?> style="text-decoration:underline" <?php } ?>>Hverdag</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=staff"<?php if($table==staff) { ?> style="text-decoration:underline" <?php } ?>>Personale</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=parents"<?php if($table==parents) { ?> style="text-decoration:underline" <?php } ?>>Forældrebestyrelsen</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=official"<?php if($table==official) { ?> style="text-decoration:underline" <?php } ?>>Officielt</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=gallery"<?php if($table==gallery) { ?> style="text-decoration:underline" <?php } ?>>Billedgalleri</a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?static=contact"<?php if($static==contact) { ?> style="text-decoration:underline" <?php } ?>>Kontakt</a></li>
</ul> </div>
<!-- indeholder trækronen som et background -->
<div id="treetop"></div>
<!-- wrapper til sidemenu og content. Indeholder træstamme som baggrund der høre repeat i venstre side som udvidere sig med indholdet og menu -->
<div id="filler">
<?php content($static,$table,$id); ?>
</div>
<!-- indeholder kalender, login som går igen på alle sider -->
<div id="sidebar">
<?php include("calendarix/minical.php"); ?><br />
<a href=".<?php $_SERVER['PHP_SELF'];?>?static=login">Personale Login</a>
</div>
<!-- footer med kontakt info til børnehaven -->
<div id="footer"></div>
</div>
</body>
</html>
min function.php:
<?php
include('db_con.php');
// henter variablen id
$id = isset($_GET['id']);
$table = isset($_GET['table']);
$static = isset($_GET['static']);
function content($static,$table,$id) {
switch ($table) {
case home:
echo 'lidt indhold';
break;
case about: ?>
<ul id="navilist">
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=2"<?php if($table==about&$id==2) { ?> style="text-decoration:underline" <?php } ?>>Her bor vi<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=3"<?php if($table==about&$id==3) { ?> style="text-decoration:underline" <?php } ?>>Lokaler og indretning<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=4"<?php if($table==about&$id==4) { ?> style="text-decoration:underline" <?php } ?>>Principper og værdier<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=5"<?php if($table==about&$id==5) { ?> style="text-decoration:underline" <?php } ?>>Områdeledelses generelt<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=6"<?php if($table==about&$id==6) { ?> style="text-decoration:underline" <?php } ?>>Børnemiljøvurdering<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=7"<?php if($table==about&$id==7) { ?> style="text-decoration:underline" <?php } ?>>Traditioner<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=8"<?php if($table==about&$id==8) { ?> style="text-decoration:underline" <?php } ?>>Praktikstedsbeskrivelse<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
</ul>
<?php
include('include/content.php');
break;
case everyday: ?>
<ul id="navilist">
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=2"<?php if($table==everyday&$id==2) { ?> style="text-decoration:underline" <?php } ?>>Børnehaven i hverdagen<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=3"<?php if($table==everyday&$id==3) { ?> style="text-decoration:underline" <?php } ?>>Madpolitik<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=4"<?php if($table==everyday&$id==4) { ?> style="text-decoration:underline" <?php } ?>>Årsplan<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=5"<?php if($table==everyday&$id==5) { ?> style="text-decoration:underline" <?php } ?>>Virksomhedsplan<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=6"<?php if($table==everyday&$id==6) { ?> style="text-decoration:underline" <?php } ?>>Sprogstimulering<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
<li><a href="<?php $_SERVER['PHP_SELF'];?>?table=<?php echo $table ?>&id=8"<?php if($table==everyday&$id==7) { ?> style="text-decoration:underline" <?php } ?>>Inklusion (sårbare børn)<img src="images/gren.png" class="branch" width="187" height="30" alt="gren" /></a></li>
</ul>
<?php
include('include/content.php');
break;
}
}
