Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $HomePage = "home.html";
- $HeaderFile = "header.html";
- $FooterFile = "footer.html";
- $ErrorFile = "error.html";
- $Ext = ".html";
- $ErrorCode = "404";
- ?>
- <html>
- <head>
- <!-- put css and js external file declarations here -->
- </head>
- <body>
- <table width="100%" border="0">
- <tr>
- <td>
- <?php
- if (file_exists($HeaderFile)){
- $headerPage = file_get_contents($HeaderFile);
- echo $headerPage;
- }
- else {
- echo "NO HEADER FILE FOUND";
- }
- ?>
- </td>
- </tr>
- <tr>
- <td>
- <?php
- //php tempate code DO NOT TOUCH!
- //email morgan at gamingrobot@gmail.com if you find bugs
- if ($_SERVER['REQUEST_URI'] != '/') {
- $urivars = explode('/', $_SERVER['REQUEST_URI']);
- for ($x=0;$x<count($urivars);$x++) $urivars[$x] = urldecode($urivars[$x]);
- }
- $contentPageURL = $urivars[2] . $Ext;
- $GetP = $urivars[2];
- //Something.com/1/2 for array locations of $urivars
- if($GetP != $ErrorCode){
- //$urlEncodedWeb = urlencode($_GET['p']);
- if($GetP === ""){
- $contentPage = file_get_contents($HomePage);
- echo $contentPage;
- }
- else{
- if (file_exists($contentPageURL)){
- $contentPage = file_get_contents($contentPageURL);
- echo $contentPage;
- }
- else {
- if (file_exists($ErrorFile)){
- $errorPage = file_get_contents($ErrorFile);
- echo $errorPage;
- }
- else {
- echo "404 Error Page Not Found";
- }
- }
- }
- }
- else {
- if (file_exists($ErrorFile)){
- $errorPage = file_get_contents($ErrorFile);
- echo $errorPage;
- }
- else {
- echo "404 Error Page Not Found";
- }
- }
- ?>
- </td>
- </tr>
- <tr>
- <td>
- <?php
- if (file_exists($FooterFile)){
- $footerPage = file_get_contents($FooterFile);
- echo $footerPage;
- }
- else {
- echo "NO FOOTER FILE FOUND";
- }
- ?>
- </td>
- </tr>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment