1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Implementing CAPTCHA

Discussion in 'PHP' started by cybercool, Feb 19, 2006.

  1. #1
    I have a form on my site which is processed by a php script. What I require is to add on a image verification entry before the form is 'submitted'. This is to prevent spamming.

    The obvious answer is implementing Captcha.

    Is there ready made and good php code out there that I can use to implement in my form / script ?

    would appreciate any feedback.

    thanks

    CC
     
    cybercool, Feb 19, 2006 IP
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    tflight, Feb 19, 2006 IP
  3. w0lfenst1en

    w0lfenst1en Well-Known Member

    Messages:
    128
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    i found a example of the same i dun remember exactly.
    you can search for "captcha" in planetsourcecode

    Thanks
     
    w0lfenst1en, Jun 13, 2008 IP
  4. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #4
    xrvel, Jun 14, 2008 IP
  5. sky22

    sky22 Guest

    Messages:
    59
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    sky22, Jun 14, 2008 IP
  6. Twayne

    Twayne Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    [QUOTE>
    The obvious answer is implementing Captcha.

    Is there ready made and good php code out there that I can use to implement in my form / script ?
    [/QUOTE]

    I know this is unsolicited advice but I thought I'd pass it along anyway:
    PHP is definitely what you need. That Captcha scripts, well, maybe not so much for few reasons (IMO/IME):
    1. Capcha images can be difficult to make out the code for those with good eyesight, let alone less than 20-20 eyesight or color blindness, for instance.
    2. Some people just plain don't like it and won't use it, so if you don't mind losing those who are less-determined to send a mail, it might be OK.
    3. IMO make the captcha image/validation happen FIRST, as an entrance to the actual form. People really hate it when after filling in a form, they come to the captcha image, get the code wrong, and have to go back and do it all over again. So be sure you make their inputs persist long enough to be able to redisplay if they have to go back and try again.

    For a local non-profit site I manage, I'm in the process of taking out the captcha images and replacing them with an entry page that asks random simple, easy to answer questions instead of the capthca image. Questions rotate, like what year was it one year ago? What day was yesterday? How many feet does a (whatever) have? and a personal question like first name or age. The last two can be sprinkled later in other scripts to verify it's still a human at the controls. And using Back button anywhere re-asks a subset of the original questions; they must still match.
    It sounds a lot more complicated in words than it really is. Just a few randoms to pick the questions, then store the answers in a session variable, and validate them. There should be very few input errors this way.
    Enter; answer questions; access to form granted, pop quiz toward end to ask for age, whatever, and send it.

    I'm considering hiding a captcha image somewhere just for the robots to waste time on if they do make it in. Nothing is 100% anyway; no idea whether my idea is even as good as Captcha but intuitively feels harder to beat, easier to fill in, even for sight impaired since text readers, etc. will still work with it. Capthcha takes a special effort to read the code for sight impaired.

    My 2 ¢ anyway.
     
    Twayne, Jun 23, 2008 IP
  7. AMF.info

    AMF.info Peon

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    
    <?php
    $img_text="text";
    
    $dest="image/code.jpg";
    
    // create a 70*25 image
    $im = imagecreate(70, 25);
    
    // white background and blue text
    $bg = imagecolorallocate($im, 255, 255, 255);
    $textcolor = imagecolorallocate($im, 0, 0, 255);
    
    // write the string at the top left
    imagestring($im, 5, 5, 5, $img_text, $textcolor);
    
    // output the image
    imagejpeg($im,$dest, 75);
    ?>
    
    PHP:
     
    AMF.info, Jun 23, 2008 IP
  8. priyakochin

    priyakochin Banned

    Messages:
    4,740
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    0
    #8
    After creating an image with this, how can we check it with the enter text ?
     
    priyakochin, Jul 6, 2008 IP
  9. shels

    shels Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
  10. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #10
    recaptcha is the best.
     
    mwasif, Jul 6, 2008 IP
  11. priyakochin

    priyakochin Banned

    Messages:
    4,740
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    0
    #11
    what is this.Can u help ?
     
    priyakochin, Jul 6, 2008 IP
  12. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #12
    mwasif, Jul 6, 2008 IP