I want to include a lot of .php files. Reason beeing that i have 4 categories of work that need be showcased.
The following code works. Though, it is basically everything i know about PHP. I am not firm with writing PHP.
<?php
if(!isset($_GET['page'])) $_GET['page']="";
switch($_GET['page']) {
case "category_a":
include('site1.php');
include('site2.php');
include('site3.php');
include('site4.php');
break;
case "category_b":
include('site5.php');
include('site6.php');
include('site7.php');
include('site8.php');
include('site9.php');
include('site10.php');
break;
}
?>
Since there are so many included sites, and i want to be able to include those categories elsewhere without listing every file again (and therefore updating the list on multiple sites).
Is it possible to simply include a path? :D This is how i imagine the solution:
case "category_a":
include('/directory/category_a');
break;
Any help is very very appreciated.