Science and Technology : Help Me to Help You

Discussion in 'Science and Technology' started by river, Feb 26, 2010.

  1. river

    river Watch Her Flow MEMBER

    Country:
    United States
    Joined:
    Mar 22, 2004
    Messages:
    6,458
    Likes Received:
    1,282
    Gender:
    Female
    Occupation:
    Author
    Location:
    Where the Niger meets the Nile
    Ratings:
    +1,290
    Hey Fambly,

    As some of you may well know I am both hearing and visually impaired. For this reason I cannot use websites such as Myspace that use image verification (captcha) to thwart spam bots. So when I created a website that had forms on it I did not want to use captcha because it would make my website inaccessible to my fellow visually impaired users. You know what they say necessity is the mother of invention. So I thought about it and came up with a totally accessible yet totally effective way to keep robots from using my forms to send spam.

    It works so well that I am itching to share it with other developers. Unfortunately the php forums where I tried to register seem to all favor the most nastiest kind of captccha so I could not even get into their forums.

    The use of captcha is ubiquitous and is keeping a lot of people from enjoying the most useful interactive websites. We can't even let the webmasters now we are having a problem. So I am turning to you hoping that you will share what I've found in those php developer forums.

    It's really simple. Nothing complicated or even ingenious about it really. No special knowledge needed. No libraries to download. Any web developer who uses php to process forms is already using these same elements. Here's the method in a nut shell:

    You have a text field in your form and give the user instructions on exactly what to put in the field. Then in your php script you store the user's input in a variable then use an if statement with a comparison operator to verify if the user typed correctly

    It works because even though the instructions are readable by both humans and robots there is nothing about the text field that tells the robot to look for instructions to fill it out. Give the field a name that means nothing to robots and they will either leave it blank or fill it with nonsense. When the robot clicks the submit button the form is sent to your php script where the if statement checks the answer and dows what you tell it to do. The robot just goes on its merry way none the wiser.


    Here is the code and the script:

    To verify that you are a human please type the bright and warm light that rises in the morning and sets in the evening. Use all lower case letters.
    <! --question should be something universally known that has only one possible answer !>
    Answer :<input type="text" name="elephant" >

    PHP script looks like this:

    $elep = $_REQUEST['elephant'];

    if($elep != "sun")
    {
    echo "If you are a human reading this please go back to the form and follow the instructions for filling out the form.";
    }
    else
    {
    //here is where you put the code to process the form
    }

    Before I started using this I got over 60 robot attacks over night. I've been using it for four days now and haven't seen hide nor tail of a robot.
     
  2. BlackAfrikan

    BlackAfrikan Member MEMBER

    Joined:
    Mar 25, 2005
    Messages:
    6
    Likes Received:
    0
    Gender:
    Male
    Ratings:
    +0
    in genius

    go river!
     
  3. KEMAKIL

    KEMAKIL Well-Known Member MEMBER

    Country:
    United States
    Joined:
    Jan 5, 2010
    Messages:
    88
    Likes Received:
    44
    Occupation:
    Electronic/Telecom Engineer
    Location:
    Chicago, IL
    Ratings:
    +44
    That's great River. I'm no developer, just wanted to congratulate you.
     
Loading...