Please pardon my PHP noobness! I want a single page to display a particular navigation based on the incoming link. It's set up as follows:
page1.php list item:
<li><a <?php if (strpos($_SERVER['PHP_SELF'], 'wood-species.php')) echo 'class="current"';?>href="wood-species.php?name=standard">Wood Species</a></li>
page2.php list item:
<li><a <?php if (strpos($_SERVER['PHP_SELF'], 'wood-species.php')) echo 'class="current"';?>href="wood-species.php?name=premium">Wood Species</a></li>
So the first link will set the name variable to "standard" using the GET method, and the second link will set it to "premium". So what I want to happen is that 'wood-species.php' displays with the appropriate navigation, but I'm not sure how to destroy or unset the 'name' variable.
Here's what I tried to use, obviously not getting it done...
<?php
$woodclass = $_GET['name'];
if($woodclass="premium") {
require("includes/premium-wide-navigation.php");
echo"premium";
clearit();
}
else if($woodclass="standard") {
require("includes/standard-wide-navigation.php");
echo"standard";
clearit();
}
else {
//
}
function clearit () {
unset($GLOBALS['woodclass']);
}
?>