Last time I wrote about using the index.php page as the gateway to the main controller:
http://dinocajic.blogspot.com/2015/07/php-using-indexphp-as-your-main.html
Since it's a secure habit to place all of your code outside of the visible directory (outside of the www or public_html folder), I've created a class that index.php directs all of the information to and that class is the one that actually processes everything.
Breakdown of the Main class
http://dinocajic.blogspot.com/2015/07/php-using-indexphp-as-your-main.html
Since it's a secure habit to place all of your code outside of the visible directory (outside of the www or public_html folder), I've created a class that index.php directs all of the information to and that class is the one that actually processes everything.
Breakdown of the Main class
- All files included in the beginning
- All required classes instantiated
- In the __construct(), the redirect is called to push all domains to a specific domain name
- Due to the amount of times certain hacks are attempted on the server, I've decided to place some of the common ones in the preventHack() method and prevent them before any other code is called.
- The available pages that the website contains are populated into an array
- Headers are processed. i.e. Logs the user in if $_COOKIE's are set
- Previous page is recorded
- Current page is stored for statistics
- The createWebsite() method is called from index.php. Everything else is self explanatory from this point on.
Comments
Post a Comment