Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page_set = false;
- if(isset($_GET['page'])) {
- $page = $_GET['page'];
- page_set = true;
- }
- $gallery_set = false;
- if(isset($_GET['gallery'])) {
- $gallery = $_GET['gallery'];
- $gallery_set = true;
- }
- include("header.php");
- if($page_set) {
- switch($page) {
- case "gallery":
- $gallery_path = "/path/to/galleries/{$gallery}.php";
- if($gallery_set && file_exists($gallery_path)) {
- include($gallery_path);
- } else {
- // include default gallery here
- }
- break;
- default:
- $page_path = "/path/to/pages/{$page}.php";
- if(file_exists($page_set)) {
- include($page_path);
- } else {
- // include home content here
- }
- break;
- }
- } else {
- // include home content here
- }
- include("footer.php");
- ?>
Add Comment
Please, Sign In to add comment