Skip to content

Nephiaust/Simple-PHP-Blog

 
 

Repository files navigation

Simple-PHP-Blog

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

Setup

  1. Create a MySQL database on your MySQL server, take note of the details (username, password, database name, server name)
  2. Import the database.sql file into the new database you created
  3. Edit the config.php file
    1. Edit the MySQL details to match your SQL server login details (e.g. server name, username, password, database)
    2. 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)
    3. OPTIONAL Change the number of blog posts to show per page with the PAGINATION option
    4. OPTIONAL Set the DEBUG_MODE option to true if you want/need to see any and all errors
  4. Upload all the files to your web server
  5. Go to your new site (e.g. www.example.com/myblog/)

URL Rewrite

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

Apache servers

There is an .htaccess file that has the required rewrite module and rule in the files.

Nginx servers

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;
}

Using the Simple-PHP-Blog

The system is quite easy to use, as there isnt much work required to do a simple blog.

Default Admin Login

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.

Screenshots

screenshot_01 screenshot_02

About

This is a simple blog built with PHP/MYSQL.

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • JavaScript 92.9%
  • PHP 7.0%
  • CSS 0.1%