Basically my question is: Shall I continue in this way?
My project file structure.
Below example based on this URL
/root -/images -/include ---database.php ---user.php ---course.php -/layout ---/user ---/course ---index.php -index.php -config.php
require("include/database.php"); require("include/user.php"); require("include/course.php"); $db = Database::getInstance(); $user = new user(); $course = new course();
<?php include('config.php'); //get view page using url $view_page = isset($_GET['view']) ? $_GET['view']: 'home'; ?> <html> <body> <div id='header'></div> <div id='content'> <?php include('layout/index.php'); ?> </div> </body> </html>
<?php include($_SERVER['DOCUMENT_ROOT'].'/layout/'.$view_page.'.php'); ?>
//this page will be displayed : www.mysite.com/index.php?view=user/index&uid=234 // user/index = (folder/page) or (view/action) // these details will be dispalyed with <div id='content'></div> <?php $userDetails = $user->getUserDetails($_GET['uid']); echo $userDetails['username']; echo $userDetails['email']; ?>