Creative Commons License

Progress Is Good

Although I've done little on my little project today, I have spent three whole days working on it this week, rather than spending my time on my dissertation like I probably should have. Still, I managed a few significant things yesterday, so I thought I'd provide another short update.

My nice to-do list can now be updated without a problem, which has helped me keep track of things nicely. I was very excited on Tuesday to find the first two bugs in the code I'd written: there were two scripts which used the $_GET() function, and were meant to perform certain actions like delete things from the database when given certain variables in the url. I had, however, mistakenly allowed the script to delete as long as something was appended to the url, regardless of what this command was. Here's an example:

http://www.noelinho.org

That's the web address.

?action=delete&post=21

Those are the variables. When put together, we get this:

http://www.noelinho.org?action=delete&post=21

Assuming the action "delete" does what it says on the tin (and it does), then it will look in the database for post 21, and delete it. Unfortunately, my carelessness meant that it would have done the same if action was equal to "create", "modify", or even "" (blank). Still, it's on my to-do list to be fixed...

However, I have, much more excitedly, managed to implement that two things I thought would be hardest: RSS feeds and nice permalinks, using mod_rewrite. The RSS feeds were quite simple once I'd realised that certain html entities break XML, and then used the necessary PHP function to strip them from strings. It probably needs a little more work, but it's functional at the very least right now. I was even more satisfied to get mod_rewrite working. For some reason, I couldn't get it to work on my local server, but once I'd uploaded the scripts to this website, I managed to get them working. Thus, I can now start with an address such as:

http://www.noelinho.org?year=2008&month=01&title=noels-first-attempt

And I end up with:

http://www.noelinho.org/alpha/2008/01/noels-first-attempt/

Awesome! mod_rewrite is brilliant... but complicated. Like, nigh-on impossible. But not quite.

There are currently no comments on this article.

Submit a Comment