ma.tt
Script Update
If you use mod_rewrite on any of your pages (like we do here) you should replace PHP_SELF with REQUEST_URI in the below code. I should have thought of that.