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
<?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>
layout/index.php
<?php
include($_SERVER['DOCUMENT_ROOT'].'/layout/'.$view_page.'.php');
?>
layout/user/index.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'];
?>