SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed for avoiding spam on simple contact form.

    Hi folks,

    I have a spam problem with my online form in
    http://www.cursos-chino.es/cursos-de...ormulario.html

    I keep receiving spam and what puzzles me is that the spam script does not need to fill the required fields to send the form.

    I tried to add a math puzzle by inserting:

    else if(document.contact_form.Filtro.value !== document.contact_form.Solucionfiltro.value) {
    alert("ˇPor favor revise su respuesta!");
    return false; }

    and

    <div class="formlabel">Demuestre que Vd. no es un espamer, escriba en letras el resultado de sumar tres y siete (en min&uacute;sculas)/div>
    <div class="formfield"><input type="text" name="Filtro" size="4" /></div>
    <input type=”hidden” name=”Solucionfiltro” value=”diez” >

    However, the hidden field still shows on the browser (it doesn't show the value but it shows an empty square) and I can't get the form check to compare the values of "Filtro" and "Solucionfiltro".

    Any help would be appreciated.

    Thx all.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Some spammers are using tricky techniques that are hard to diagnose, and really tough to properly combat.

    You may want to consider instead using a tried and tested captcha solution, such as reCaptcha.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    All that is needed to bypass your code is to turn off JavaScript. The spammers all do that as their first step.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,099
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could indeed use Captcha as Paul suggested, another option would be using server side scripting, in your case PHP which you already use for your pages anyway
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  5. #5
    Non-Member
    Join Date
    Jan 2011
    Location
    Heaven
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't recommend using javascript for your captcha because it won't work in browsers with javascript turned off. Google took over reCaptcha some time ago and it's one of the better free, easy to implement captchas. The only downside of reCaptcha is that it isn't very flexible regarding styling, but depending on your skill level in php, you might consider building your own customised captcha.

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx all,

    Tried recaptcha, but I haven't quite figured how to integrate it in the website.
    Will work on it.

    Cheers.

  7. #7
    SitePoint Member
    Join Date
    Feb 2008
    Location
    Georgia - USA
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use a pretty good contact form that seems to do a good job of blocking spam bots. You can find it at this link: http://green-beast.com/gbcf-v3/
    HawkDawg


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •