Forum Moderators: coopster
<style type="text/css">
ul { list-style-type: none; margin: 0.5em 0 0 0px; padding: 0; position: relative; overflow: visible; height: auto; }
ul li { height: 2.0em; width: 200px; }
ul li a, ul li a:visited { width: 200px; height: 2.0em; display: block; color: #999; text-decoration: none; background: #525252; margin: 0.8em 0 0 0; text-indent: 10px; }
ul li a:hover { display: block; background: #eee; color: #333; }
ul li a.currentpage, ul li a.currentpage:visited { background: #FF7F50; color: #000; }
</style>
<?php
ob_start();
$pass = array('home','news');
if (in_array($_GET['id'], $pass)) {
//include('http://www.mysite.com/nav.php?page='.$_GET['id']);
include ($_GET['id'] . '.php');
}
include('nav.php');
I am not sure 100% what you mean.
If you declare a variable it will be parsed throughout all files included. e.g.
$pass = array('home','news');
if (in_array($_GET['id'], $pass)) {
//include('http://www.mysite.com/nav.php?page='.$_GET['id']);
include ($_GET['id'] . '.php');
}
Now, $pass is accessible from the "$_GET['id'] . '.php'" file, if that makes any sense?
Please could you supply us with a little more information on what you are trying to achieve?
Thanks
Del
$pass = array('home','news');
if (in_array($_GET['id'], $pass)) {
include ($_GET['id'] . '.php');
}
include('nav.php'); I was thinking to rewrite it this way so the output be below the nav menu hightlighting the current page.
$pass = array('home','news');
if (in_array($_GET['id'], $pass)) {
include('http://www.mysite.com/main.php?page='.$_GET['id']);
include('nav.php');
include ($_GET['id'] . '.php');
}
$pass = array('home','news');
// inside nav.php - check if (in_array($_GET['id'], $pass))
include('nav.php');
if (in_array($_GET['id'], $pass)) {
include('http://www.mysite.com/main.php?page='.$_GET['id']);
include ($_GET['id'] . '.php');
}
Am i on the right lines?
Thanks for listening ...