Hello, I am a PHP beginner. I have developed a social networking website similar to Orkut in PHP.
The basic program flow of my website is redirect everything to index.php
The index.php determines the $_SERVER['REQUEST_URI'] and does what needs to be done and render the output.
I initiaze all the classes at the top of index.php I want to know if it is a good practice to do this or not.
The index.php starts like this :-
// all the configuration files
require_once ("siteconfig.php");
// include library files / classes
require_once "lib/auth.php";
require_once "lib/album.php";
require_once "lib/db.php";
require_once "lib/form.php";
require_once "lib/inbox.php";
require_once "lib/social.php";
require_once "lib/profile.php";
require_once "lib/user.php";
require_once "lib/settings.php";
require_once "lib/validate.php";
require_once "lib/logs.php";
require_once "lib/sms.php";
// initialize all the classes
$db = new db($dbuser, $dbpass, $dbname, $dbhost);
$validate = new validate();
$auth = new auth();
$user = new user();
$profile = new profile();
$social = new social();
$settings = new settings();
$usersearch = new usersearch();
$album = new album();
$logs = new logs();
$liveupdates = new liveupdates();
$sms = new sms();