Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define ("ServerName", $_SERVER['SERVER_NAME']);
- define ("RequestedURI", $_SERVER["REQUEST_URI"]);
- /*
- If Package is located in a subdirectory:
- Is in a subdirectory: true
- If in main root: false
- */
- define ("IsSubDir", true);
- /*
- Name of the templates directory
- */
- define ("TemplateDir", "Templates"); // Template To be used
- /*
- Template Name To Use
- */
- define ("TemplateName", "Fluid");
- /*
- Location of the directory which the smarty class is located
- */
- define ("SmartyLib","libs"); // Location to Smarty
- /*
- Packages Physical Path
- */
- define ("SitePhysical","C:\xampp\htdocs\SPT");
- /*
- Require the Smarty Class
- */
- require(SmartyLib."/Smarty.Class.php");
- /*
- Require the Post Validations page
- */
- require ("./Post.Valid.php");
- /*
- Require The Main API
- */
- require ("./Libs.Inc.php");
- /*
- Create an array from the $_SERVER['REQUEST_URI']
- */
- $Parameters = explode("/",$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
- /*
- Use Unset to remove the first index, this being the website eg:
- 127.0.0.1/
- */
- unset($Parameters[0]);
- /*
- Check if the constant: IsSubDir is set to true
- */
- if (IsSubDir){
- /*
- If set to true, remove the second index of the array which would contain the SubDirectory
- */
- unset($Parameters[1]);
- }
- /*
- Re-index the $Parameters array this is being done so the index is set back to 0
- */
- $Parameters = array_values($Parameters);
- /*
- Create the link to the main API
- */
- $Views = new Smarty_Views(TemplateDir,TemplateName);
- /*
- Create the link to the Post Validation API
- */
- $FormValidation = new Post_Validations;
- /*
- */
- if (isset($_POST)){
- if (in_array("FormID",$Parameters)){
- $Form_Key = array_search("FormID",$Parameters);
- $Form_Key++;
- #echo $Parameters[$Form_Key];
- $FormValidation->FormID($Parameters[$Form_Key]);
- }
- }
- /*
- Display The Page which is located in the first element of the new array
- */
- $Views->Display_Page($Parameters[0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement