This site is a self-contained low down on what's going on in my life, what I'm working on, what I'm thinking about, and how I'm feeling about life in general.
Tuesday, 19 February 2008
I've just been dabbling with Apache's mod_rewrite functionality and it is super-sweet. It's one of those techniques that you just see everywhere these days.
I followed this example, which was easy to follow, to control the redirect.
I've implemented it on the tag system and also the categories and I'm really impressed with the results. Give it a try.
Tuesday, 19 February 2008
I wanted to create a tag cloud, and looked at Cal Evans's Cloud Generator, which to me seemed overly complex, though very stable I'm sure. I just thought that it would be easier to work it out myself and tailor the solution to my needs.
It was actually easier to do than I thought.
Click here for the source code.
Monday, 18 February 2008
Due to a failure in the heating system in work today, we were all sent home early. In fairness it was bloody freezing.
After a 3 hour power nap, I got up and finally completed the tagging system for the blog.
It works simply though an onBlur function on an input box, splitting the tags into an array and inserting them into the database. Each keyword is passed separately so that I can check if it already exists in the database, in increment the usage accordingly so that I can later create a tag list, sized around popularity.
It's a start anyway, and it works well, which is all I want. Off on holiday tomorrow, and hoping to be off Wednesday to help Lisa.
Monday, 11 February 2008
This series of articles will cover the theory behind creating a simple eCommerce system.
Of all the components of an eCommerce site, the shopping cart will be the hardest to develop.
We will store an md5 session key that will link back to databased transactions.
It's easier than you think to build an eCommerce site, sometimes it's just having that guidance on process to complete it.
Below is some example code you can use to create and store your MD5 key.
session_start();
if($cartID == ''){
if(isset($_SESSION['cartID'])) {
$cartID = $_SESSION['cartID'];
echo 'Loaded from session: Cart ID: '.$cartID;
} elseif(isset($_COOKIE['cartID'])) {
$cartID = $_COOKIE['cartID'];
$_SESSION['cartID'] = $cartID;
echo 'Loaded from cookie: Cart ID: '.$cartID;
} else {
$cartID = md5(uniqid(rand(),true));
$_SESSION['cartID'] = $cartID;
setcookie('cartID', $cartID, time() +432000);
echo 'Created md5 key: '.$cartID;
}
}