Help needed Preventing Automated Registrations

Discussion in 'Programming' started by JapaneseCupid, Jun 22, 2006.

  1. #1
    Does anyone know of a good download of Alpha-Numeric images that contain codes to prevent automated registraions. I would apreciate it.
     
    JapaneseCupid, Jun 22, 2006 IP
  2. DXL

    DXL Peon

    Messages:
    380
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    These are called CAPTCHAs. Google for this to find a variety of scripts to generate them. I've also written one myself once, here's the code:
    
    <?php
    header('Content-type: image/png');
    header('Cache-Control: no-cache, must-revalidate');
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 
    
    $chars = chars(4);
    
    $im = imagecreatetruecolor(100, 60);
    
    $bgcolor = imagecolorallocate($im, 0, 255, 0);
    imagefill($im, 0, 0, $bgcolor);
    
    $fgcolor = imagecolorallocate($im, 255, 0, 0);
    $angle = rand(-30,0);
    
    imagefttext($im, 30, $angle, 0, 30, $fgcolor, 'garabold.ttf', $chars);
    imagefttext($im, 30, $angle, 1, 31, $bgcolor, 'garabold.ttf', $chars);
    
    imagepng($im);
    imagedestroy($im);
    
    function chars($number){
        $hash = 'abcdefghijklmnopqrstuvwxyz';
        for($i=0; $i<$number; $i++){
            $result .= substr($hash, rand(0, 25), 1);
        }
        return $result;
    }
    ?>
    
    PHP:
    garabold.ttf is Garamond Bold, probably present on your computer.
     
    DXL, Jun 22, 2006 IP
  3. KalvinB

    KalvinB Peon

    Messages:
    2,787
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #3
    A simple captcha I used was one which asked simple questions. Those don't even have to be an image. You just need to have a lot of questions.
     
    KalvinB, Jun 24, 2006 IP
  4. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #4
    Exactly. Like:

    1. Are you a bot? Y/N

    2. If answer = Y, goto 1

    JapaneseCupid, is this for a forum or something similar? If so, what software are you using?
     
    minstrel, Jun 24, 2006 IP
  5. RichardRosse

    RichardRosse Peon

    Messages:
    96
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    what about "who is better looking?" test :)
     
    RichardRosse, Jun 25, 2006 IP