Simple blog system for personal development using procedural PHP and MySQLi. It allows you to create, edit, delete posts to get you started on your journey. If you are building your own from scratch this will give the head start that you need.
For educational purposes only.
Security is not guaranteed with this system, best efforts have been made to make it secure
- Create a MySQL database on your MySQL server, take note of the details (username, password, database name, server name)
- Import the
database.sql
file into the new database you created - Edit the
config.php
file- Edit the MySQL details to match your SQL server login details (e.g. server name, username, password, database)
- Edit the
SITE_ROOT
if you are putting it in a folder/sub-directory (e.g. www.example.com/myblog/, you would enter 'myblog' there) - OPTIONAL Change the number of blog posts to show per page with the
PAGINATION
option - OPTIONAL Set the
DEBUG_MODE
option totrue
if you want/need to see any and all errors
- Upload all the files to your web server
- Go to your new site (e.g. www.example.com/myblog/)
The system now uses slugs, also known as SEO URLs
The blog posts URL structure is like this: http://www.example.com/myblog/p/4/apple-reveals-apple-watch-series-7
, where the p/4/apple-reveals-apple-watch-series-7
is the slug
There is an .htaccess file that has the required rewrite module and rule in the files.
If you use NGINX, you can insert something similar to the code below in your NGINX configuration block.
location / {
rewrite ^p/(.*) view.php?id=$1;
}
The system is quite easy to use, as there isnt much work required to do a simple blog.
Username: admin
Password: 12345
There is no way to update the admin password through the dashboard yet.
To change your password, hash your password with PHP's password_hash()
function. Then update the database value with the new password hash.