fl00d
07-01-2007, 03:29 AM
ok... another thing. I'm trying to make a navigation bar.
This is my current code.
<?php
echo "<a href=\"/en/trails/index.php?category=dirtjump\">Dirt Jumps</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/dj.inc");
}
echo "<a href=\"/en/trails/index.php?category=park\">Park</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/park.inc");
}
echo "<a href=\"/en/trails/index.php?category=urban\">Urban</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/urban.inc");
}
?>
Even when I just click one link, the included files of ALL 3 links show up. Example:
Non-clicked
Dirt Jumps
Park
Urban
When just ONE is clicked;
Dirt Jumps
hello
helloPark
helloUrban
'Hello' is the single word contained in the the included files for now.
I understand why its showing all of them... because isset($_GET['category']) HAS been already set, right?
What I can't think of is an alternative method to prevent this. A switch statement popped into my mind, although I haven't quite figured out yet how I would use that. I'm working on it though. Any suggestions?
I'm about to go hit up Google and see if I find anything there. Hopefully when I'm done with Google there will be a reply :)
This is my current code.
<?php
echo "<a href=\"/en/trails/index.php?category=dirtjump\">Dirt Jumps</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/dj.inc");
}
echo "<a href=\"/en/trails/index.php?category=park\">Park</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/park.inc");
}
echo "<a href=\"/en/trails/index.php?category=urban\">Urban</a><br \>";
if(isset($_GET['category']))
{
include("/home/user/public_html/include/urban.inc");
}
?>
Even when I just click one link, the included files of ALL 3 links show up. Example:
Non-clicked
Dirt Jumps
Park
Urban
When just ONE is clicked;
Dirt Jumps
hello
helloPark
helloUrban
'Hello' is the single word contained in the the included files for now.
I understand why its showing all of them... because isset($_GET['category']) HAS been already set, right?
What I can't think of is an alternative method to prevent this. A switch statement popped into my mind, although I haven't quite figured out yet how I would use that. I'm working on it though. Any suggestions?
I'm about to go hit up Google and see if I find anything there. Hopefully when I'm done with Google there will be a reply :)