Background
I created a gaming community website about 13 years ago. It uses PHP, SQL, HTML, and CSS. It, and does not use a framework or template engine. It includes features such as a login system for members, different levels of access depending on your rank, dropping members that are inactive from the member list, and other features useful to a gaming community. At its height, the gaming community that this website supported had 300 active members, so this code has been in production for a while. This website's PHP code has about 97 versions.
Questions
##Questions
Do I need to learn a framework like Laravel and convert everything to that? The learning curve for frameworks looks steep. Is it worth it? What kinds of features do they provide?
Do I need to start using classes and OOP? What are the benefits? Where would I start? As you can see, all of my code from this sample page is non-OOP.
Feel free to give any feedback you'd like on the code I've included.
I am already aware of a couple of things that I should upgrade. For example, I need to convert from MYSQL to PDO for security, a template engine like Smarty is better for code readability, I should sanitize my incoming $_POST data, I should use an ENUM for access levels instead of numbers, etc. There's a lot that needs to be upgraded.
Sample Code
##Sample code
Edit: Security
##Security
My website's lack of security has been mentioned in several posts. I do have some security, since this is production code. I just didn't post the gigantic function and navigation files that get loaded before the code for this specific page. Here is some of the security code.
SQL Injection Defense Codeinjection defense code
XSS Defense Codedefense code
Expiring Cookiescookies
IP Ban For Too Many Login Attemptsban for too many login attempts