would any one know a way I could write this array so I did not have to include a file for 'name'. 'name' is used for defining the included 'page'. So I can high light the current link. for every page thats included I have to include a separate file with define('this_page', 'home'); and the next define('this_page', 'about');.
a away I could use something like echo('name'); or print and define('this_page', 'home'); will echo. Then I would not have to write a file for every page.
$pages = array (
1 => array('name' => 'set/home.txt' , 'title' => 'No Title' , 'page' => 'pages/home.txt'),
2 => array('name' => 'set/about.txt' , 'title' => 'About Us' , 'page' => 'pages/about.txt'),
3 => array('name' => 'set/contact.txt' , 'title' => 'Contact Us' , 'page' => 'pages/contact.txt')
);
if (isset ($_GET['id'])) {
$pageID = $_GET['id'];
if (! isset($pages[$pageID])) $pageID = 404;
} else {
$pageID = 1;
}
include($pages[$pageID]['name']); //defines the page