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”

Did you like this? Share it:

CafePress random product update

A small update is required to the CafePress box class – the one that shows a random product from your CafePress store. This is needed because there have been some additional updates to the HTML on the CafePress side, so the regular expression in the class needs updating. It’s very easy; just change line 174 for the following:

$this->cpPattern = '.*?(.*?)
\$([^< ]*)';
Did you like this? Share it: