Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Capcha

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default Capcha

    Hey guys,
    How can I add CAPTCHA in a regular .php mailform ?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Uh... that's complex.

    You need to use the GD library to dynamically generate an image based on input and then later compare that original input to what the user types. Furthermore, you need to create it with distortion so a computer can't read it.

    As I said, complex.

    You could alternatively have images you created by hand (say 10 of them might work for a small site) and corresponding 'correct' values for them that would later be matched. Be sure never to output that value, just keep it secure in the php code.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Read this thread.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Nov 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    http://chovy.dyndns.org/php/captcha.php

    just did this one in a few hours. although most of that time was looking for a TTS library.

    It's probably not worthy of a high-traffic site, as I'm not tweaking the text or background (yet anyway).

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Most decent servers already have a GD library installed, and I found a nice little file that will tell you, you can download it below.

    Just rename it to gd-test.php, upload to your domain, browse to the page and view the results. If you have it then no need for all the extra worrying
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #6
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Thanks guys.
    What code do I need to add to the mailform ?

  7. #7
    Join Date
    Nov 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    what language is it in?

  8. #8
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    html sending to a php

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    just did this one in a few hours. although most of that time was looking for a TTS library.
    Festival will serve your purposes. Run it against a Sable XML file or a Scheme script, not just plain text: this will allow you more control over the factors required for transformation.
    It's probably not worthy of a high-traffic site, as I'm not tweaking the text or background (yet anyway).
    It won't even provide a barrier. There are freely-available CAPTCHA breakers out there that will crack that with a 100% success rate in milliseconds.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    What code do I need to add to the mailform in order to get a capcha ? The form is made in .html submitting to a .php.

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
  •