Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Includes

Status
Not open for further replies.

yumbelie

Programmer
Dec 31, 2002
96
GB
Hi, Is it possible to dynamically include a variable? To explain, I have a page formed of three different pieces of PHP, a header, footer, left side (options) and centre (the actual data). I include all these pieces into one php file (the left side - options one) and then the page is rendered to screen. What i want to do tho is vary the contents of the include statement dynamically, e.g.:

If the user clicks on option-->meals then the include statement has "include center_data_meals.php", if they then do suboption-->menu, I want the page to be re-rendered, but this time include "include center_data_menu.php" instead. Basically like frames, only done in PHP and rendered each time afresh.

Thanks.

Yum.
 
No Matter. Solved It. For Anyone who cares, I didn't realise that now you use $_GET[variablename] instead of just $variablename in the PHP code, when you pass variables with the GET method.

Oh well, all works now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top