I have admin.php: It includes the various scripts into the main table layout.
<tr><td><? echo "\n<!-- INCLUDE HEADER START-->\n";
include("heading.php");
echo "\n<!-- INCLUDE HEADER FINISH-->\n";?></td></tr>
<tr><td><? echo "\n\n<!-- INCLUDE MAIN CONTENT START-->\n\n";
//SEARCH
if (isset($mode)){include("search.php");}
Then I have heading.php: it provides nav links depending on what $vars are set.
if (isset($mode)) //SEARCH
{
if ($mode=1)//advanced?
{
if (isset($submit))
{
$heading="Search Result.";
$head_nav="<a href=\"admin.php?mode=1\">Search Again</a>";
}
else
{
$heading="Advanced Search.";
$head_nav="<a href=\"admin.php?mode=2\">Simple Search.</a>";
}
}
if ($mode=2)//Simple?
{
if (isset($submit))
{
$heading="Search Result.";
$head_nav="<a href=\"admin.php?mode=2\">Search Again</a>";
}
else
{
$heading="Simple Search.";
$head_nav="<a href=\"admin.php?mode=1\">Advanced Search.</a>";
}
}
} //END SEARCH
And then search.php which initially checks for advanced or simple ($mode1, 2). If I comment out the code in the heading the $mode is there and search.php shows the right content, but with the code in the heading it will only ever recognise $mode as 2, even when it has mode=1 in the calling URL!
Any Ideas?