Tims' Blog

Visit the Old WP Blog

Take Me Home

HFS Simple Blog 1 - What and Why?

A lot of folks are setting out on their journey to learn how to "program" websites using PHP.

One of the best ways to learn PHP is to create something basic, but useful.
So what better "thing" to create than a Very Simple Blog System, with a twist.

I have three motivations for doing this. These are more like questions I have, that need to be answered.

  1. Having used things like Wordpress and CodeIgniter and other frameworks which use a lot of code, could I write something super lightweight?
  2. Just how far could I take this in regards to the "features" of a full blown Blog that uses a much more complex script?
  3. And could I use it to both demonstrate and teach the basics of PHP?

The Rules

So we had best state some Rules that we want to adhere to for our "Simple Blog".

So lets dive into this...Is it possible?

The short answer is obviously Yes as what you are seeing right now is the actual live "Very Simple Blog" PHP Script in action!

So what I have in mind is a minimal number of files, which at the moment, is a single index.php file.

I also want to create the files locally on my development system and simply upload them to a folder, which allows the system to read the files.

Of course there needs to be some minimal PHP for each page to allow for things like, the order and grouping of articles.

Being a site where I want to display "code samples" I needed some way to syntax highlight the code to make it more readable. So I have discovered and employed a PHP Built in Function, called highlight_file($filename). This lets me show actual files in all their glory.

More coming.

There will be more added to this. I have kind of thrown what I have working, up on the Live Site (Here), to see if it will run happily on my web hosting. And it does work, well right after I had to do a small tweak to my .htaccess file - Thank Goodness for Google and knowing how to look for answers! That was a brief moment of "Hmmmm - it works fine on my local server..."

In the Meantime... Feel Free to Hit the Next Button and dive into some of the Coding Goodness of where we are currently at.
You don't need piles of code to do great things :)

Prev hfs-simple-blog-3
Next hfs-simple-blog-2