Only have index.php as an entry point
Instead of having a whole bunch of redundant code in each file (DB initialisation for example), it would be useful to have just the
index.php as the entry point of the site.
Then, require/include any other files there.
This reduces the duplicate code by quite a bit and makes it easier to manage.
First step towards refactoring and grouping code nicer.