What’s this blog about?

Date: 10 Mar, 2008
Posted by: admin
In: Uncategorized

Bookmark and Share

WordPress

This site has been moved from a self written PHP site to be a WordPress site as of 2008-03-10. This page tells you how the site got here, but not really what it’s about – I haven’t decided that bit yet.


How I created this site …

This site used to be at geocities. In fact, it was there for a good many years, probably about 7 in total (since about 1996) – that’s how long I’ve been creating web pages.

Anyhow, I’ve just recently started to migrate to PHP (PHP Hypertext Processor) to write these pages. Why? Well it allows the pages to be dynamic – reacting to users – it also has enabled me to template the site.

hacked

I got hacked (April 2004) from some nice Indonesians on dal.net using my website to launch IRC bots! Hopefully now I’ve plugged the hole. Suffice to say revealing my source wasn’t probably the best idea!?! (This might not have been how they got in, we’ll see). I suspect a php injection attack – I’ve hardened my code and the following is no longer representative of what I do … if you want to get hacked then use it ;0)>

If you need to know how to fix a similar problem then drop me a line and I’ll point you in the right direction.

I’ve rewritten my index.php page as follows (as of 22March04):

 <?php include('head.php'); /* other meta and page head tags can be added now */ ; ?>

 <meta name="description" content="flapjacktastic" />

 <meta name="keywords" content="minidisk knoppix " /></head>

 <body>

 <?php

 include('title.php');

 include('nav.php');

 ?>

 <div id="content">

 <?php

 if (isset ($_GET['content']))

    { $included = $_GET['content'] . 'Inc.php'; }

 el>

    { $included = 'indexInc.php';	}

 include($included);

 ?>

 </div><!-- end content div -->

 <?php

 include('foot.php');

 ?>

So what does all that do?

First, one should note that the site originally was comprised of a lot of html files. [There’s info about how it developed in the stuff pages]. I then added includes (Server Side Includes) which took the form “<#include … >”. This is like a very wimpy version of PHP includes, I think it works using CGI. There was at that time one file for each page, “aboutme.html” for example, that file made use of includes for header, site title, navigation and footer. Pretty nifty, saved a load of time.

Next generation was PHP, there are still some vestiges left: Each page was still a seperate file, but now I used PHP includes and made use of things like “filemtime” to give a read out of when the page was last editted. Each page had a .php, eg “aboutme.php”, and an Inc.php, eg “aboutmeInc.php”. The aboutmeInc.php page had all the content and the other page was simply a wrapper for including header, footer, navigation and the Inc page.

The current situation is that I thought … ‘this is crazy’ to change a page I have potentially to alter both the .php and the Inc.php page. So instead I use the above scripting …

The vestiges are the meta-tags, in the previous incarnation I could have different meta tags depending on the page that was requested, that’s not so easy now though. Here I use a $content variable in the addresses. This variable is then retrieved with $_GET and used to decide the file to include, if there isn’t a $_GET[‘content’] variable then it defaults to index.

This will probably change quite alot over the next few weeks I get more into PHP and learn how it’s supposed to be done, from sites like php.net. For example, I’ll be looking at how to efficiently serve different meta-tags depending on my $content variable and probably look into some sort of caching regime

Laterz

Other to do stuff:

  1. Allow link to name tags in eg linuxPavIssues
  2. Work on design side of things

Sorry, comments are closed.


About

Flapjacktastic is just a random collection of musings, hints&tips, notes, information ... a collection of stuff really that's overflowed from the brain of this husband, father, potter, business-man, geek ...

past posts