syco Posted June 19, 2008 Share Posted June 19, 2008 would this work to do index.php?area=anythinghere <?php$area = $_['GET']include("topnav.inc");include($area".inc");include("bottom.inc");?> Link to comment Share on other sites More sharing options...
boen_robot Posted June 19, 2008 Share Posted June 19, 2008 You forgot a semicolon here: $area = $_['GET'][b];[/b] Otherwise, if you have a file named "anythinghere.inc" which is in the same folder as "index.php", then yeah, it would work. Link to comment Share on other sites More sharing options...
Wander Posted June 19, 2008 Share Posted June 19, 2008 ya also for a dot: include($area.".inc");if you want to include 'anythinghere.inc' with index.php?area=anythinghereuse$area = $_GET['area'];include($area.'.inc'); Link to comment Share on other sites More sharing options...
king Posted June 19, 2008 Share Posted June 19, 2008 You should put anythinghere.inc (or whatever file) in a separate directory (e.g. a directory called areas) so someone doesn't include bottom.inc or topnav.inc $area = basename($_GET['area']); // Make sure it's a valid fileinclude 'topnav.inc';if (file_exists('areas/'.$area.'.inc')) // Make sure the file existsinclude 'areas/'.$area.'.inc';include 'bottom.inc'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.