A PHP script for converting between different datetimes

This script converts a Unix timestamp (Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)) to the International Standard ISO 8601 date and time notation (YYYY-MM-DD hh:mm:ss) and vice versa. I find it useful for verifying datetimes.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ [...]

Protecting a download using a unique URL

A client asked me to develop a simple method for protecting a download (or digital product) by generating a unique URL that can be distributed to authorized users via email. The URL would contain a key that would be valid for a certain amount of time and number of downloads. The key will [...]

A PHP script for testing a MySQL database connection

A simple page for testing the connection to a MySQL database. The PHP script will test the server address, username and password. If the database field is left empty, it will return a list of available databases. Testing a specific database is optional, but if a database name is supplied, it will [...]

Resolving transaction concurrency issues in a PHP+MySQL multi-user environment

I’ve been developing a PHP/MySQL web application that involves multiple users opening and editing records in the database. There is a very real possibility that two or more people will open the same record, make changes, and attempt to save these changes.
The most common concurrent execution problem that I expect to see is the [...]

Using timestamps to reduce WordPress comment spam

In this post, I’ll explain how to reduce the amount of comment spam your WordPress blog receives by using an unobtrusive ‘handshake’ between the two files necessary for a valid comment submission to take place. I’ve written a few different articles on reducing comment spam by means of a challenge response test that the [...]

A collection of PHP code snippets

This is a collection of php code snippets that seem to come in handy rather often. They are assembled here more for my own organization than anything else.
String: trim and convert to lowercase
A very straightforward but useful snippet. A string is first trimmed of any leading or trailing white space, and then converted [...]

Fixing warnings in the WordPress Sociable plugin

I’ve fixed some errors that I was experiencing with version 2.0 (dated 2007-02-02) of the Sociable WordPress plugin by Peter Harkins. Specifically, when running WordPress 2.2+, I would get the following warnings when saving changes:
Warning: implode() [function.implode]: Bad arguments. in PATH\wp-content\plugins\sociable\sociable.php on line 651

Warning: Invalid argument supplied for foreach() in PATH\wp-content\plugins\sociable\sociable.php on line 762

For [...]

Defeating contact form spam by hiding the webmail script

My clients and I have been receiving increasing amounts of spam sent through our own contact forms. Not being a spammer myself, I’m left to speculate on how one sends spam through a webmail form, but I’ve come up with two ways of preventing it from happening. Both of these methods involve editing [...]

A plugin for adding the post date to wp_get_archives

The WordPress function wp_get_archives(’type=postbypost’) displays a lovely list of posts, but won’t show the date of each post. This plugin adds each post’s date to those ‘postbypost’ lists, like so:
Recently

07.10Completed contract projects for July 2008
06.27A PHP script for converting between different datetimes
06.11Protecting a download using a unique URL
05.26A PHP script for testing a MySQL [...]

Halo 3 Service Record WordPress Plugin

This plugin allows you to add information from your Halo 3 Service Record to your WordPress blog.
The plugin displays your emblem, rank and grade, but with a little editing it could also display total the total number of games played, the date and time of the last game played, and any other information on the [...]