Advertisement
Guest User

Untitled

a guest
Nov 11th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. define ("ServerName", $_SERVER['SERVER_NAME']);
  2.  
  3. define ("RequestedURI", $_SERVER["REQUEST_URI"]);
  4. /*
  5. If Package is located in a subdirectory:
  6. Is in a subdirectory: true
  7. If in main root: false
  8. */
  9. define ("IsSubDir", true);
  10. /*
  11. Name of the templates directory
  12. */
  13.  
  14. define ("TemplateDir", "Templates"); // Template To be used
  15. /*
  16. Template Name To Use
  17. */
  18. define ("TemplateName", "Fluid");
  19. /*
  20. Location of the directory which the smarty class is located
  21. */
  22. define ("SmartyLib","libs"); // Location to Smarty
  23. /*
  24. Packages Physical Path
  25. */
  26. define ("SitePhysical","C:\xampp\htdocs\SPT");
  27.  
  28. /*
  29. Require the Smarty Class
  30. */
  31. require(SmartyLib."/Smarty.Class.php");
  32. /*
  33. Require the Post Validations page
  34. */
  35. require ("./Post.Valid.php");
  36. /*
  37. Require The Main API
  38. */
  39. require ("./Libs.Inc.php");
  40.  
  41. /*
  42. Create an array from the $_SERVER['REQUEST_URI']
  43. */
  44. $Parameters = explode("/",$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
  45. /*
  46. Use Unset to remove the first index, this being the website eg:
  47. 127.0.0.1/
  48. */
  49. unset($Parameters[0]);
  50. /*
  51. Check if the constant: IsSubDir is set to true
  52. */
  53. if (IsSubDir){
  54. /*
  55. If set to true, remove the second index of the array which would contain the SubDirectory
  56. */
  57. unset($Parameters[1]);
  58. }
  59.  
  60. /*
  61. Re-index the $Parameters array this is being done so the index is set back to 0
  62. */
  63. $Parameters = array_values($Parameters);
  64.  
  65. /*
  66. Create the link to the main API
  67. */
  68. $Views = new Smarty_Views(TemplateDir,TemplateName);
  69.  
  70. /*
  71. Create the link to the Post Validation API
  72. */
  73. $FormValidation = new Post_Validations;
  74.  
  75. /*
  76.  
  77. */
  78. if (isset($_POST)){
  79. if (in_array("FormID",$Parameters)){
  80. $Form_Key = array_search("FormID",$Parameters);
  81. $Form_Key++;
  82. #echo $Parameters[$Form_Key];
  83. $FormValidation->FormID($Parameters[$Form_Key]);
  84. }
  85. }
  86.  
  87.  
  88. /*
  89. Display The Page which is located in the first element of the new array
  90. */
  91. $Views->Display_Page($Parameters[0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement