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