Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Image Validation

    Hi all, i am looking for some code to prevent bots and spammers that are taking liberty’s with my simple form mail via my websites. I have Goolged but i am not finding anything.

    All help would be great.

    Mike
    Kind regards,
    Mike Hughes

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    It's called image CAPTCHA

  • Users who have thanked Mwnciau for this post:

    hughesmi (11-10-2007)

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Thanks Dude.

    Mike
    Kind regards,
    Mike Hughes

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    It is better to know about Inaccessibility of CAPTCHA
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder cheat's Avatar
    Join Date
    Nov 2006
    Location
    England, Britain
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just do something like this use it if you wish to.


    <?
    session_start();

    header("Expires: Sat, 17 Nov 2007 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);

    header("Pragma: no-cache");

    header("Content-type: image/gif");

    $image = imagecreate(85, 15);


    $black = imagecolorallocate ($image, 3, 3, 3);
    $white = imagecolorallocate ($image, 255, 255, 255);

    /*

    $rand1 = rand(0, 10);
    $rand2 = rand(0, 10);

    imageline($image, 0, $rand1, 65, $rand2, $white);

    $rand1 = rand(0, 10);
    $rand2 = rand(0, 10);

    imageline($image, 0, $rand1, 65, $rand2, $white);

    */

    $font = "FONT.ttf"; //font


    $string1 = rand(0, 9);
    $rotate = rand(-0, 0);
    $y = rand(15, 15);
    ImageTTFText($image, 10, $rotate, 5, $y, $white, $font, $string1);

    $string2 = rand(0, 9);
    $rotate = rand(-0, 0);
    ImageTTFText($image, 10, $rotate, 25, $y, $white, $font, $string2);

    $string3 = rand(0, 9);
    $rotate = rand(-0, 0);
    ImageTTFText($image, 10, $rotate, 45, $y, $white, $font, $string3);

    $string4 = rand(0, 9);
    $rotate = rand(-0, 0);
    ImageTTFText($image, 10, $rotate, 65, $y, $white, $font, $string4);




    $string = $string1;
    $string .= $string2;
    $string .= $string3;
    $string .= $string4;

    $_SESSION[verify] = md5($string);

    imagegif($image);
    imagedestroy($image);
    ?>


    Then just create a function for checking the image. simple.

  • #6
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts
    I just managed to implement jCaptcha, just to find that it is bunch of code, bunch of dependencys, and doesn't look right. So I made it mayself in couple of lines. Heire is how result looks:



    Did find edges on it with some programs, no usable stuff, what do you think is this OK ?

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by BubikolRamios View Post
    I just managed to implement jCaptcha, just to find that it is bunch of code, bunch of dependencys, and doesn't look right. So I made it mayself in couple of lines. Heire is how result looks:



    Did find edges on it with some programs, no usable stuff, what do you think is this OK ?

    There will be a percentage of people who will be unable to see the numbers in that image.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts
    I thinked of that, but think this percentage is not significant ?
    If not significant I can always tell them to send me email or something.

    Anyway I'm quite sure that OCR and stuff (tested it with Abby fine reader and nothing) could not read this, especialy if I rotate each character a bit ?
    Last edited by BubikolRamios; 12-09-2007 at 05:01 AM.


  •  

    Posting Permissions

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