Here's what I did to stop the evil bots from spamming me via the comments form.
Step #1Add a hidden field into your template's comment form (usually found in image.php), for example;
``
Step #2At the top of your main index page (not the templates index page), add the following line at the top before anything else;
`<?php if(
@$_POST['comment'] && @!$_POST['matt_spamkiller']) die(); ?>`
Done!This has stopped all comment spam on my website.
Cheers,
Matt
Comments
Ooh, I like some of these ideas... perhaps I'll try implementing them myself...
With a special number of <tab> characters, we could use autoit to spam a database... Too easy to perform...
Nevertheless, you can generate random fields...
Fields' names are stored in the database, a key is created in a session's array ($key, $image_name). After usage, database and session are cleaned up.
Random fields can be used only one time by one client...
But that would not block a bot which submits correctly the form... (just use autoit to discover how easy it is to do it)
the idea is to put an empty input fields and hide him in CSS.
When you register the comment, if this field is not empty then it's a spam bot...
You can find an article on this page :
http://www.rustylime.com/show_article.php?id=338
Sorry for my bad english, i need to improve it !
- ensure that the field has been submitted
- ensure that the field is empty
More over, it won't be efficient against automation tools that would simulate normal viewing and submitting actions...
If the field is OK, then an heavy way to check if everything is ok...
I'd rather use my spamassassin method to check comments Ackismet never worked as expected on my gallerry... with spamassassin, 2 things:
- No spams are inserted at all
- No spammer try to do it anymore !!! I think they stop trying after several errors...
Though as things stands now, several scripts already works well: Akismet, Spam Karma, Spam Assassin... etc, the only problem is to port and integrate them into Zenphoto - I'm thinking of the long proposed plug-in system.
This proves the hack works well for me. May not catch everything, but I have yet to find a solution that does. Akismet is the best I've found though so far.
It will eventually have moderation capabilities, but this assumes edits to core zenphoto code, and database modifications.
I wonder if a flash form would stop spam 100%?
Robots will improve the way they spam. So it's just a temp fix...