Hi there guys,
i am not very sure if this has been asked before me,i am bit confused on what is the proper way of organizing or rather coding a website. I usually try to redirect all my pages to index.php with arguments for example
index.php?m=login where i include the proper file based on the value of "m".
<?php
if($_REQUEST['m']=='login')
include_once('./login.php');
?>
my index.php looks something like this
<?php
/ Start holding the output /
ob_start();
/ Define the necessary Headers /
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/ Do the necessary Includes - classes, css etc /
include_once('./includes/dynamictext.inc.dl');
require_once($_SERVER['DOCUMENT_ROOT'].'/includes/browser.class.php');
.....
?>
But again, the index.php has all the includes, for various classes - does redirecting the page to index.php make the files include again? and is this a bad practice or a good practice? and i even have a adodb class, does including this class again and again for each page has an adverse effect, like making too many connections to mysql?
Honestly am a little confused, can anybody shed some light on the properway of coding a project?