By fiasst-1 on
Hi, I'm looking to block comments containing 'http://' or 'www.' in the name, subject, email or comment body fields. I would like PHP to prevent the comment from posting instead of JavaScript due to spam-bot/bastards still getting past my captcha...
Is this possible? I haven't a clue where/how to do this.
Thanks for any help
Comments
Rules
Rules (http://drupal.org/project/rules) module is your friend.
Hi thanks for your suggestion
Hi thanks for your suggestion Azol but im using Drupal 5 and was hoping for a simpler solution to an upgrade.
Anyone?
That means you are facing the
That means you are facing the task of programming it by yourself, correct?
Then take a look at hook_comment (http://api.drupal.org/api/function/hook_comment/5), you most likely will have to process $op=="validate" operations - your PHP code will check comment's body and title and strip all "bad words" from it, for example. I am not a developer, but you can search for code snippets on using these hooks.
That looks like the job!
That looks like the job! thanks, ill look into it.