Category-first structure
Articles are grouped into categories such as Security, Troubleshooting and User Feedback, each with its own article listing.
A case study in building a content platform on PHP and MySQL: categorised articles, a three-state lifecycle, Admin and Customer roles, AJAX search, and defences against SQL injection and XSS.

The Knowledge-Based Article Management System is a PHP knowledge base I built for organisations that publish and maintain help articles, such as businesses, educators and knowledge-sharing communities.
Admins write, categorise, archive and remove articles, while customers find and read them. It runs on PHP and MySQL, with Bootstrap and AJAX on the front end and protection against SQL injection and XSS.
Readers come in through categories such as Security, Troubleshooting and User Feedback, or search by keyword. Behind that, every article sits in one of three states, Active, Archived or Deleted, and only Active articles reach a reader.
Help content tends to collect in the wrong places: old emails, a shared drive of near-identical documents, or the memory of whoever has been around longest.
When someone needs an answer they ask a colleague, and the same question gets answered over and over.
A knowledge base only fixes that while it stays maintained. Articles go out of date; deleting them outright throws away history that might still matter, and leaving them up misleads readers. The people writing the content also need a different view of the system from the people reading it. Most of the design effort therefore went into managing an article across its whole life, with publishing as one stage of it.
| Before Knowledge-Based Article Management System | With Knowledge-Based Article Management System |
|---|---|
| Answers buried in old emails and shared drives | Articles grouped into categories, each with its own listing |
| The same question answered over and over | Search by keyword, category or status |
| Outdated articles deleted, or left up to mislead | An Active, Archived and Deleted lifecycle |
| One view for writers and readers alike | Separate Admin and Customer dashboards |
The brief I set myself
I built the application end to end, from the MySQL schema and the PHP logic to the admin and customer dashboards and the Bootstrap interface.
That covered the PHP logic for articles, categories, users and search, and an interface built with Bootstrap and JavaScript. Working in PHP without a framework meant writing the pieces a framework usually hands you, such as session checks, input validation and output escaping, and knowing exactly which attack each one closes off.
| Database | The MySQL schema linking articles, categories and users, with indexes on the category and status columns. |
|---|---|
| Back end | PHP logic for articles, categories, users and search, plus small endpoints called over AJAX. |
| Access | Admin and Customer roles held in the server-side session and checked at the top of every admin page. |
| Security | Prepared statements, output escaping with htmlspecialchars, hashed passwords and a fresh session id at login. |
| Interface | The admin and customer dashboards, built with Bootstrap, HTML5, CSS3 and JavaScript. |
An article has a life beyond publishing: an admin writes and files it, readers find it, and when it goes out of date it is archived instead of destroyed.
Step 1
An admin writes the article and files it under a category, where it appears in that category's listing.
Step 2
Customers browse by category or search by keyword, with results updated over AJAX. Customer-facing queries only return Active articles.
Step 3
An admin archives an outdated article without losing their place in a long list. It drops out of the customer view at once but stays available to admins.
Step 4
Deleted works as a holding state that can still be reviewed, so a removed article is not gone until an admin decides it should be.
The features split along the two roles: admins get the tools to write, organise and retire articles, and customers get a fast way to find them.
Articles are grouped into categories such as Security, Troubleshooting and User Feedback, each with its own article listing.
Every article is Active, Archived or Deleted, and admins move it between those states.
Each role has its own dashboard and its own permissions, checked on every page.
Find articles by keyword, category or status, with results updated without a page reload.
Changing an article's status happens over AJAX, so an admin keeps their place in a long list.
Protection against SQL injection, XSS and unauthorised access on every form and page.
Passwords are stored as hashes, and the session id is regenerated at login.
Articles and dashboards read well on any screen size.
Four decisions shaped the build: relational tables for the content, prepared statements for input, escaping on output, and AJAX wherever a full reload would get in the way.
Data
The data is relational by nature: every article belongs to a category, has an author and sits in exactly one lifecycle state. MySQL with keys linking those tables keeps the relationships consistent, and turns a category page or a status filter into a single indexed query instead of a pass over every article.
Security
Search boxes and filters are the usual route in for SQL injection, because user input ends up inside a WHERE clause. Every query that accepts input uses a prepared statement with bound parameters, so a search term is always treated as a value and never as SQL, whatever characters it contains.
Output
Articles are content written by one user and shown to others, which is exactly the shape of a stored XSS attack. Titles, search terms and other text fields are escaped with htmlspecialchars at the moment they are rendered, so markup typed into any of them appears as plain text instead of running in a reader's browser.
Interaction
In a classic PHP app, running a search, applying a filter or changing an article's status would each reload the whole page. Small PHP endpoints called over AJAX return only the data that changed, so results update in place and an admin can archive an article without losing their position in a long list.
| Technology | What it does in Knowledge-Based Article Management System |
|---|---|
| PHP | Server logic for articles, categories, users, sessions and search, written without a framework. |
| MySQL | Relational storage for articles, categories and users, queried through prepared statements. |
| HTML5 | The markup for the dashboards and article pages. |
| CSS3 | Styling on top of Bootstrap. |
| JavaScript | Client-side behaviour, including the requests behind search and status changes. |
| AJAX | Search results and admin actions updated in place, without a page reload. |
| Bootstrap | The responsive grid and components for both dashboards. |
Three problems shaped most of the code: retiring articles without losing them, keeping customers out of admin pages, and fast, safe search on plain MySQL.
Problem
A hard delete is final, and in a knowledge base the article removed today is sometimes the one a customer still has bookmarked tomorrow. Keeping everything visible is no better, because outdated instructions do more harm than no instructions.
Solution
Articles carry a status instead of being removed from the table. Archived articles drop out of the customer view but stay available to admins, and Deleted works as a holding state that can still be reviewed. Customer-facing queries only return Active articles, so an article disappears for readers the moment it is archived.
Problem
In a PHP app each page is its own entry point. Forget the permission check on one admin page and a customer who guesses the URL can open it; hiding the link in the menu protects nothing.
Solution
Every admin page begins with the same check against the role held in the server-side session and redirects anyone without the Admin role before any data is loaded. Passwords are stored as hashes, and the session id is regenerated at login so an old session cannot be reused.
Problem
Readers expect search to respond straight away, but the project runs on MySQL alone, and a query with several optional filters is easy to write badly or unsafely.
Solution
The search endpoint builds its WHERE clause only from the filters actually set, binds each as a parameter, and returns results over AJAX so only the list redraws. Indexes on the category and status columns keep filtered queries cheap.
The finished system gives admins one place to write, organise and retire articles, and gives readers a category-first way in.
The screenshot shows that way in as cards for Security, Troubleshooting and User Feedback. Archived content stops cluttering what readers see, and nothing an admin removes is gone until they decide it should be.
Role-based access appears in several of my projects, and the same idea changes shape with the stack. Here it is two roles enforced through PHP sessions on each page; in the MERN team management system with three roles it moves into Express middleware and a signed JWT.
The next steps would be version history for each article, so edits can be compared and rolled back, and MySQL full-text search that ranks results by relevance. Rebuilding the reader side as a single-page app, along the lines of my Vue.js job board, would also make moving between categories faster.
Short answers to the questions people ask most about this knowledge base, its article lifecycle and how it stays secure on plain PHP.
A system for writing, organising and maintaining help articles so people can find answers themselves. This one is built in PHP and MySQL, groups articles into categories, and manages each article across an Active, Archived and Deleted lifecycle.
PHP and MySQL on the server, with HTML5, CSS3, JavaScript, AJAX and Bootstrap on the front end. There is no PHP framework underneath it.
Every query that takes input uses a prepared statement with bound parameters, so input is always treated as a value. Text is escaped with htmlspecialchars when it is rendered, so markup typed into an article or search box shows as plain text.
An archived article drops out of the customer view but stays available to admins. Deleted is a holding state that can still be reviewed, so nothing is gone until an admin decides it should be.
Admins write, categorise, archive and remove articles from their own dashboard. Customers find and read Active articles by category or search. Every admin page checks the role before loading any data.
Muhammad Abdullah Awais, a full-stack developer based in Pakistan. I built it end to end, and I am available for freelance and full-time work on products like it.
A multilingual Next.js tools platform with 340+ localized pages and country-specific tax logic in 7 languages.
Read the case studyTeam work on a construction AI platform: assistant features with user approval and document extraction that shows its source.
Read the case studyA free NSCT exam preparation platform with 33,800+ CS MCQs and a configurable quiz engine.
Read the case studyI work remotely with teams in the US, Canada, the UK, Europe and the Gulf, and with clients across Pakistan. Based in Pakistan (PKT, UTC+5), available for freelance and full-time roles.