g_stanton4142 wrote:its still not really clear what you want 🙂
You said that you wanted to open the page and for it to say gallery instead of gallery with the href. Looking at the code you have written, the solution i gave you seems adequate to do that.
What exactly do you want to be shown on the page?
Here is the full code. It is menu.php and is included in all of my pages.
<?php
$theuri = $_SERVER['REQUEST_URI'];
if ( ($theuri =="/") or ($theuri =="/index.php") )
{
$itemis = "Home";
} else {
$itemis = "<a href=\"/index.php\" target=\"_self\" class=\"nav\">Home</a>";
}
echo $itemis;
?>
::
<?php
$theuri = $_SERVER['REQUEST_URI'];
if ($theuri =="/gallery/")
{
$itemis = "Gallery";
} else {
$itemis = "<a href=\"/gallery/\" target=\"_self\" class=\"nav\">Gallery</a>";
}
echo $itemis;
?>
::
<?php
$theuri = $_SERVER['REQUEST_URI'];
if ($theuri =="/recipes/")
{
$itemis = "Recipes";
} else {
$itemis = "<a href=\"/recipes/\" target=\"_self\" class=\"nav\">Recipes</a>";
}
echo $itemis;
?>
::
<?php
$theuri = $_SERVER['REQUEST_URI'];
if ($theuri =="/map/")
{
$itemis = "Map";
} else {
$itemis = "<a href=\"/map/\" target=\"_self\" class=\"nav\">Map</a>";
}
echo $itemis;
?>
::
<?php
$theuri = $_SERVER['REQUEST_URI'];
if ($theuri =="/about.php")
{
$itemis = "About Me";
} else {
$itemis = "<a href=\"/about.php\" target=\"_self\" class=\"nav\">About Me</a>";
}
echo $itemis;
?>
When you visit my site, you see this:

When you click on Gallery, you see this:

When you click on About Me, you see this:

You notice that the word Gallery is not white when you are on the gallery page. The reason for this is that there are many pages that in the gallery folder. So instead of specifying
if ( ($theuri =="/gallery") or ($theuri =="/gallery/index.php") or ($theuri =="/gallery/main.php") or ($theuri =="/gallery/blah.php") or ($theuri =="/gallery/blah.php") )
I just want to be able to use a wild card so it detects any page in the gallery folder and displays the menu like this:

Part of the problem is the way the links are: /gallery/main.php?g2_view=core.ShowItem&g2_itemId=28
How can I get my menu script to detect that I am on the gallery page without hard coding the links. It works fine on the rest of my pages.