How this website was made. PHP, CSS, and Folders.

Disclaimer: This is nothing fancy. I started out with HTML back in the 90's, started using Wordpress in the 00's, and lost interest in the 10's. I am a casual computer user, and didn't keep up with the times. I wanted something I could keep in one folder on my Desktop again. There is a lot of great flat file code out there, but I wanted something I could understand and control. I have tried to keep any code that I borrowed with the authors name. First things first.

Here is what the public_html folder looks like

The main .htaccess file

The .htaccess file redirects pages so they look like they are all in folders, when it is actually a file. Any requests for http://dspl.ca/j, or http://dspl.ca/j/ will be shown the page j.php and the same for the other user pages. It also strips any www. from requests.

<p><i>Proudly powered by a <a href="http://tarot.freeshell.org/leafpad/">Text Editor</a> and some <a href="https://duckduckgo.com/">Internet Searches</a>.</i></p>

<?php include("./footer.php"); ?>

The header.php

It is mostly the original header.php out of my wordpress installation so I could keep my existing style.css file. After that is a piece of code I added and modified by Chirp Internet: www.chirp.com.au that takes the contents of my categories folder (in the public_html root), displays each folder name, and links to each folders index.php.

So there is a folder called categories, with all of the subjects we want to show in the menu. Any pages in the root of the site will get the categories menu across the top.

Next. Looking into a category

Let's take a look inside the first directory, Camp

Each folder in categories contains a index.php that has a structure like categories/Camp/index.php below.

It uses a special menu called headercat.php that displays links back to our home pages, and a link back to categories. It then calls on cat.php which displays all of the pages in that directory, using the code modified in a different way fom Chirp. I added a way for it to read the first line from each file from a date stamp so it would display them based on their post date.

At this point, you just start adding content. Add folders (as long as you add the index.php that looks like this)

Each folder needs a index.php to land on. Once again, here's the one from categories/Camp

and then add each post in each category as Name_of_Post.php using the same Name_of_Post for the title and using the <!--date=20141027 --> date stamp, headercat.php and footer.php includes like shown below.