Monthly Archive for March, 2007

Nice image swapping

Here’s a nice, clean, and simply way to swap an image on a click of a link. You might use this if you have one large image a series of thumbnails, and when you click on the thumbnail you want to swap the large image.

This javascript will do that and you don’t even need any additional libraries!

Continue reading ‘Nice image swapping’

HTTP status codes

Quite often I find myself having to send a HTTP status code in the PHP I’m writing. This typically comes down to usually a ‘Forbidden’, ‘No Content’ or a redirect. The trouble is, I usually can’t remember the exact code of text used for the slightly more obscure codes, or at least the ones I don’t use often… Well, even for the ones I use often, if truth be told!

So I put them all in the following function which you may find useful, too.

Continue reading ‘HTTP status codes’

String encoding for HTML

I find this a handy function to encompass a number of different string encoding routines. It allows you to do entity encoding (ÿ), hex (á), html (&aecute;), or url encoding (%E1).

Continue reading ‘String encoding for HTML’