Sillyness Spelled Wrong Intentionally


Thwart the Comment Spammers...

Penned 16 years ago. 1:42 Reading Time.

was playing.

Well the comment spammers have pissed me off enough to actually do something about it.

I have written the first half of a script that will allow me to encumber thier progress some.  Basically I added a table to my database that stores IP's that I wish to ban, then I created a script that queries the client attempting to connect to this site and if the IP is listed in the database they get a nasty message.  If they are not then the actual content of the site is loaded.

My next step is to write a hack for my blogging software that will allow me to add IP' to the database with one click from the admin panel, then I am going to automate the updating of the database by finding website that hosts a list of the IP's and adding any new ones each night to my database.

If you want some measure of protection now, and don't mind manually adding the IP's to your database, the here is the code that you need to include in your pages:

0) {
print "You smell and your momma dresses you funny! Get out of my site!" ;

And here is the script you need to add the appropriate table to your DB:

ID int(12) NOT NULL auto_increment,
IP varchar(25) NOT NULL default '',

Now this example is written for my blogging software of choice Wordpress so you will have to adapt it to what you use.

So that is it, pretty vanilla stuff really.  I have mine set up as index.php, it then includes content.php if it passes the check, so none of my functions are broken, since it is technically still index.php.

More on this later, as I refine the script and add the missing components.

I hope you enjoyed reading Thwart the Comment Spammers...
By becoming a Patron of Sillyness by throwing a buck in the jar or by buying me a coffee you can ensure quality writing, film, photography and music like this continue to be made available.

Sillyness Spelled Wrong Intentionally is a registered periodical: ISSN #1544-4104,
© 2001 — 2020 Chris J. Davis and has been kicking it old school for 19 years, 4 months and 1 week.
Beautiful photos courtesy of Unsplash.