For those who are interested, I’ve just uploaded some of my photos from Phill and Phil’s wedding to the members’ area gallery, photoLounge extra. The members’ area is password protected, so if you are a friend and don’t have the password, e-mail me and I’ll let you know!

Uploading those pictures prompted me to make my gallery code a little more robust. Being a home-grown project, it’s tailored to fit my own individual purposes, and expands its capabilities as and when I need it to! The problem I had when I uploaded the latest batch of photos was the inclusion of single apostrophes, which caused problems with both HTML and PHP parsing. After a lot of fiddling around I finally fixed it, through using a combination of stripslashes() to remove escape slashes and htmlspecialchars() to replace special HTML characters with their respective character codes. The trick was getting them in the right order, so that PHP could locate the folder and files correctly and then later ensure that the output to HTML was correctly formatted. A bit complicated, but I got there in the end! The result is that the gallery code should be a little more robust and will cope with apostrophes in file names and folder names too.

Categories: Miscellaneous


Phill · 28 June 2006 at 10:57 pm

You also need to apply stripslashes() in the element of the page, Matthew 🙂

Phill · 28 June 2006 at 10:57 pm

doh! It stripped out HTML… what I meant to say was the TITLE element of the page

Matthew · 29 June 2006 at 9:27 am

So I do! Thanks for pointing that out, I had forgotten that I’d put stuff in the title as well! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.