Guest User

Untitled

a guest
Jul 17th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <?php
  2. $HomePage = "home.html";
  3. $HeaderFile = "header.html";
  4. $FooterFile = "footer.html";
  5. $ErrorFile = "error.html";
  6. $Ext = ".html";
  7. $ErrorCode = "404";
  8. ?>
  9. <html>
  10. <head>
  11. <!-- put css and js external file declarations here -->
  12.  
  13.  
  14. </head>
  15. <body>
  16. <table width="100%" border="0">
  17. <tr>
  18. <td>
  19. <?php
  20. if (file_exists($HeaderFile)){
  21. $headerPage = file_get_contents($HeaderFile);
  22. echo $headerPage;
  23. }
  24. else {
  25. echo "NO HEADER FILE FOUND";
  26. }
  27. ?>
  28.  
  29. </td>
  30. </tr>
  31. <tr>
  32. <td>
  33. <?php
  34. //php tempate code DO NOT TOUCH!
  35. //email morgan at gamingrobot@gmail.com if you find bugs
  36. if ($_SERVER['REQUEST_URI'] != '/') {
  37. $urivars = explode('/', $_SERVER['REQUEST_URI']);
  38. for ($x=0;$x<count($urivars);$x++) $urivars[$x] = urldecode($urivars[$x]);
  39. }
  40. $contentPageURL = $urivars[2] . $Ext;
  41. $GetP = $urivars[2];
  42. //Something.com/1/2 for array locations of $urivars
  43. if($GetP != $ErrorCode){
  44. //$urlEncodedWeb = urlencode($_GET['p']);
  45. if($GetP === ""){
  46. $contentPage = file_get_contents($HomePage);
  47. echo $contentPage;
  48. }
  49. else{
  50. if (file_exists($contentPageURL)){
  51. $contentPage = file_get_contents($contentPageURL);
  52. echo $contentPage;
  53. }
  54. else {
  55. if (file_exists($ErrorFile)){
  56. $errorPage = file_get_contents($ErrorFile);
  57. echo $errorPage;
  58. }
  59. else {
  60. echo "404 Error Page Not Found";
  61. }
  62.  
  63. }
  64. }
  65. }
  66. else {
  67. if (file_exists($ErrorFile)){
  68. $errorPage = file_get_contents($ErrorFile);
  69. echo $errorPage;
  70. }
  71. else {
  72. echo "404 Error Page Not Found";
  73. }
  74.  
  75. }
  76. ?>
  77.  
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>
  82. <?php
  83. if (file_exists($FooterFile)){
  84. $footerPage = file_get_contents($FooterFile);
  85. echo $footerPage;
  86. }
  87. else {
  88. echo "NO FOOTER FILE FOUND";
  89. }
  90. ?>
  91.  
  92. </td>
  93. </tr>
  94. </table>
  95. </body>
  96. </html>
Add Comment
Please, Sign In to add comment