Dynamic Menu using parameter passed via get and a require
Posted: Mon Mar 01, 2010 1:32 pm
Please can someone help me with the following problem? I believe the code I have is rendering correctly but not being executed in time.
I've passed a parameter from one page to another anit recieves it OK (will echo out and display within the page fine).
I have also used requires for certain repeated elements of common pages.
I'm now trying to use the paramater to call one of a set of specific menu lists that are tailored to the parameter being passed between pages.
But it fails to call in the menu item correctly.
I can get it to create the following if $PPP passes 1
but it just writes it to the page rather than use it how I intended.
I can copy its output into a page and open that page and menu list 1 will appear.
Obviously this is not much use for a dynamic menu system.
Suggestion as to how I may get it to execute rather than display much appreciated.
Cheers,
Bob
I've passed a parameter from one page to another anit recieves it OK (will echo out and display within the page fine).
I have also used requires for certain repeated elements of common pages.
I'm now trying to use the paramater to call one of a set of specific menu lists that are tailored to the parameter being passed between pages.
Code: Select all
echo "require('nav_".$PPP.".php')";But it fails to call in the menu item correctly.
I can get it to create the following if $PPP passes 1
Code: Select all
<?php
require('nav_1.php');
?>I can copy its output into a page and open that page and menu list 1 will appear.
Obviously this is not much use for a dynamic menu system.
Suggestion as to how I may get it to execute rather than display much appreciated.
Cheers,
Bob