Web Security & Best Practices How do you secure your home? By installing locks, only giving your house keys to your family members, making sure the fence is high enough, installing CCTVs, and probably a lot more that I don’t know about. But what about your web application? Is your app secure? How do you even know if it’s secured? How can a person hack an application? In this post I will be sharing about web application security and the best practices. There are a few common exploits a hacker can use against you. Common Exploits SQL Injection Let's start with something basic that you may have heard about. SQL injection prey on applications where a user can affect an SQL query directly. Say you have a table list with a search on top, and you developed this on vanilla PHP with no framework and no input sanitization. Chances are, a user can input an SQL script into the search bar and have direct access to your database. Try this and see:
; DROP TABLE users; If the users table is d...
MVC (Model-View-Controller) The most-common, traditional approach where files are grouped by type . CodeIgniter 3 uses MVC. Characteristics: Centralized folders for all Controllers, Models, and Views. Best For: Small to medium-sized projects. Pros: Very simple to set up. You literally can't mess this up. Cons: Might become serabut as the project grows. Still usable though. Directory Example: HMVC (Hierarchical Model-View-Controller) An evolution of MVC. Further organizes files into modules . Characteristics: Each feature has its own folder containing its own MVC structure. Best For: Medium to large-scale projects. Pros: Much cleaner folder structure. Can easily be moved or reused in other projects. HAVC (Hierarchical Asset-View-Controller) A specialized variation of HMVC, popularized by the Trongate framework. Characteristics: Replaces the "Model" folder with an " Asset " folder. Structure: Everything specific to a module, including models, CSS, Java...