I cleaned up the script a little and made it easy to integrate into your website. The first attempt at a topic destroyed all the plus symbols and it got too messy and confusing. So this should be useful to anyone with a website and PHP. You will only need to upload it, set a directory permission and paste a line of text.
I am putting this online as a file so that It can be updated if I find mistakes (which is possible). Or If anyone adds good features and optimisations. Better than writing the code here and losing the ability to edit it after 24 hours!! GRRR!
Instructions are in the anti_dos_php. file inside the zip file, unzip it at upload the file and folder to your site. You will CHMOD a folder (set write permissions, done using FTP usually eg. FileZilla or webftp on dreamhost) and paste an include() command into one of your .php files - that is all you need to do to have it working. Test it out by hitting F5(reload page) a lot on your site really fast.
Note: It is hosted by my friends on AlternityRPG.Net - a website devoted to the greatest Pen-N-Paper Role Playing Game of all time. Better than ADnD2nd Ed, better than d20, better than Palladium - I played all those and many other crap systems for 10 years before finding the awesome simplicity and flexibility that is the Alternity RPG system. </end fanboy mode>