Forum Moderators: coopster

Message Too Old, No Replies

Dynamic Navigation Menu

What's the best way to accomplish this menu? Include, an array, or what?

         

zander213

10:17 pm on May 9, 2005 (gmt 0)

10+ Year Member



Hi Everyone,

I need to build a dynamic menu that will include certain links depending on what variables are in the URL. This is doable - right?

For example: catalog.php?product=widget&color=green

Menu would look like:

Green Widgets
Brand 1 Green Widget
Brand 2 Green Widget
Brand 3 Green Widget
etc.

Any help would be greatly appreciated!

zander213

5:45 am on May 10, 2005 (gmt 0)

10+ Year Member



Am I able to use an include tag with a URL Variable maybe? For example:

<?php include('widget_nav.inc');?> is working now...

but what if I tried something like:

<?php include($HTTP_GET_VARS['widget']'_nav.inc');?>

is there a way to get something like this working?

dcrombie

7:49 am on May 10, 2005 (gmt 0)



<?php include($_GET['widget'] . '_nav.inc'); ?>

You should check that this isn't exploitable.
eg. index.php?widget=/etc/passwd