For databases, I always use mySQL's InnoDB engine, as it supports cascading of foreign keys, and database triggers, both of which are very helpful when keeping a clean database, plus also let me be a little more forgetful when writing the code, without jeopardizing quality.
For handling the requests, just a very standard MVC model. I have a .htaccess file in the root directory with:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?route=$1 [L,QSA]
So every HTTP request where the file doesn't exist, gets sent to index.php?route=URI. It picks up the URI, parses as needed, and uses the first part as the main controller / handler. For example, going to domain.com/admin/ gets routed to the administration panel, domain.com/rest/ gets routed to the handler for the REST API, etc. If a controller / handler doesn't exist with the first segment of the URI, the request is handed off as the public web site.
Then two directories, /tpl/ for actual actual TPL / HTML templates, and /php/ for the PHP files that execute any needed code for the templates. For example, if going to domain.com/admin/user/create, it gets routed to the admin panel handler, auth is checked, then the file at /php/admin/user/create.php is executed, which displays the template at /tpl/admin/user/create.tpl.
Then for libraries / classes, I just use PHP's autoload() function. I have a /lib/ directory, so if you init say:
If not already loaded, it will load the library at /lib/user.php. I don't know, but works well for me, and keeps everything nice and organized.