MVC architecture in PHP I have developed a few web applications according to my own coding style similar to MVC architecture. I'm a self learner. But there is no controller class or model class. In my way, I don't split the URL. I have mentioned below an example URL. Now I'm familiar with this process, but I know this is not a professional level coding, so I tried to move to MVC. Now I can easily manage any javascript, ajax call. I don't know how to use JavaScript and Ajax in MVC. 

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


Cofig.php

require("include/database.php");
require("include/user.php");
require("include/course.php");

$db = Database::getInstance();
$user = new user();
$course = new course();


index.php

&lt;?php
include('config.php');

//get view page using url
$view_page = isset($_GET['view']) ? $_GET['view']: 'home';

?&gt;
&lt;html&gt;
&lt;body&gt;   
   &lt;div id='header'&gt;&lt;/div&gt;
   &lt;div id='content'&gt;
      &lt;?php
        include('layout/index.php');
      ?&gt;
   &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


layout/index.php

&lt;?php 
    include($_SERVER['DOCUMENT_ROOT'].'/layout/'.$view_page.'.php');
?&gt;


layout/user/index.php

//this page will be displayed : www.mysite.com/index.php?view=user/index&amp;uid=234
// user/index = (folder/page) or (view/action)
// these details will be dispalyed with &lt;div id='content'&gt;&lt;/div&gt;

&lt;?php

$userDetails = $user-&gt;getUserDetails($_GET['uid']);

  echo $userDetails['username'];
  echo $userDetails['email'];

?&gt;
Code Review:


Naming Convention: $variableNames and functionNames() should be in camelCase, ClassNames should be in CamelCaps. Keep this convention to make your code more readable!
Use an autoloader: To stop you from being worried about loading classes, use an autoloader. See spl_autoload_register() for registering an autoloading function.
Don't use Singletons: Do not use Singletons. Singletons are global, they introduce hidden dependencies to your code and make it unpredictable and untestable.
No explicit dependncies in sight: What does your user object need in order to work? I'm guessing a database connection, maybe even a user_id? Why are you not passing those to the user's constructor?

$user = new User($db, $_SESSION["user_id"]); // For example



How to improve

This code, contrary to popular belief, is not MVC. MVC stems from good OOP practices, and the separation of concerns. The idea is to separate your application into three major layers:


The Input: The Controller layer.
The Output: The View layer.
The Processing and Logic: The Model layer.


Where each has its own job and responsibilities, its own set of objects, and its own role in the application.

I propose you start with learning about OOP, avoid PHP frameworks, and once you grasp OOP, start looking at MVC.