index.php

<?php
 $forside = array( "file" => "forside.php", "page" => "forside",
 		"title" => "Min hjemmeside", "menu" => "forsiden" );
 $om_side = array( "file" => "om.php", "page" => "om",
 		"title" => "Om hjemmesiden", "menu" => "om" );
 $produkter = array( "file" => "produkter.php", "page" => "produkter",
 		"title" => "Produkter", "menu" => "produkter" );
 $kontakt = array( "file" => "kontakt.php", "page" => "kontakt",
   		"title" => "Kontakt", "menu" => "kontakt" );
 
 $pages = array( $forside, $om_side, $produkter, $kontakt );
 
 $page = $pages[0];
 if( isset( $_REQUEST["page"] ) ) {
	foreach( $pages as $a_page ) {
		if( $a_page["page"] == $_REQUEST["page"] ) {
			$page = $a_page;
			break;
		}
	}
 }
?>

<html>
<head><title><?php echo $page["title"];?></title></head>
<body>
<?php 
 include("header.php");
 include("menu.php"); 

 echo '<div id="content">';
 include( $page["file"] );
 echo '</div>';
 include("footer.php");
?>

</body>
</html>


www.peterlind.dk

Nyeste blog-indlæg