Hi j007w,
You could do this but it's not very good solution. The better way is to write an array with all your pages, with something like id or ather name for the page. Then you can write one function and call it in your index file. The function should search the array and choose the write file to include. To do this, you must pass a parameter with the Url.
Ok, something like this.
your navigation schuld have links, which look like this:
<a href="index.php?id=145">
and the array:
function storeCategory(){
$category = array(
0 => array("id" => 145, "name" => "Theme x", "page"=> "theme_x.php"),
1 => array("id" => 146, "name" => "Theme y", "page"=> "theme_y.php"),
);
return $category;
}
And in you function you should do something like this:
function getContent($id){
$content = storeCategory();
for($x=0; $x<sizeof($content); $x++){
if (rtrim(ltrim($content[$x]["id"])) == $id){
$print_content = rtrim(ltrim($content[$x]["page"]));
}
return $print_content;
}
Now you need to call the function: getContent where you need to include your content-page. For example:
if($id){
$link = get_content($id);
include("$link");
}
It's better to do this with database, where you can store all your content pages but i needed a solution without db so i found this out.
Alice