I actually might have an answer for this one!
What I have been using is a XHTML/PHP combo using the following:
Code:
<!-- XHTML Form -->
<form name="navForm" action="post" method="navigate.php">
<input type="hidden" name="pageHint" value="" /> <!-- This serves as a buffer to hold the hinted page name -->
<input type="button" value="Home" onClick="javascript:pageHint.value = 'home';" /> <!-- This changes the value of the pageHint field -->
<input type="button" value="About Us" onClick="javascript:pageHint.value = 'aboutus';" /> <!-- This changes the value of the pageHint field as well -->
<!-- ... Fill in as many buttons as you want here, following the examples above -->
<input type="submit" name="navSubmit" value="Go" />
</form>
And the PHP: (navigate.php)
PHP Code:
<?php
if (!$_POST['navSubmit'] || !$_POST['pageHint'])
{
die(); // Kill it!
}
$page = $_POST['pageHint'] . '.php'; // Takes the name string (i.e. 'aboutus') and tacks a PHP file extension onto it (i.e. 'aboutus.php')
if (!is_file($page))
{
die(); // Kill it with FIRE!
}
else
{
include($page);
}
?>
Bookmarks