SHOW:
|
|
- or go back to the newest paste.
1 | - | $category_set = false; |
1 | + | $fallback = "home.php"; |
2 | if(isset($_GET['category'])) { | |
3 | - | $category_set = true; |
3 | + | |
4 | $file_path = "menu/{$category}.php"; | |
5 | - | } |
5 | + | if(file_exists($file_path)) { |
6 | - | |
6 | + | include($file_path); |
7 | - | $file_path = "menu/{$category}.php"; |
7 | + | } else { |
8 | - | if($category_set && file_exists($file_path)) { |
8 | + | include($fallback); |
9 | - | include($file_path); |
9 | + | } |
10 | } else { | |
11 | - | include("home.php"); |
11 | + | include($fallback); |
12 | } |