I have had similar code in my weblog for a while, with one exception. Just before the “die” I have this; header(“Location: ” . $HTTP_REFERER);

This way, if I’m lucky, the machine used to referrer-spam you (usually a windows box with a virus) will attempt to fetch the page of the referrer, eating their resources instead of yours.

since I’ve been using this, referrer spamming is way, way down on my weblog…