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 2 of 2

Thread: CAPTCHA help!

  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CAPTCHA help!

    i have a chaptcha code for my form, and its not working. all it does is output five black boxes. below are the codes i use

    this is verification.php
    PHP Code:
    <?php 
    header
    ("Content-type: image/jpeg");

    $im imagecreate(12,16); 
    $white imagecolorallocate($im,255,255,255); 
    $black imagecolorallocate($im,0,0,0); 

    $new_string $_GET[code];
    $new_string substr($new_string,17,6); 
    $new_string $new_string[$_GET[p]];

    imagefill($im,0,0,$black); 
    imagestring($im,3,3,1,$new_string,$white); 
    imagejpeg($im); 
    imagedestroy($im); 
    ?>
    and this is what i put in the form
    PHP Code:
    <fieldset>
    <legend>Image Verification</legend>
    <?php
    for ( $p 0$p <= 5$p++ ) {
    echo 
    "<img src='script/verification.php?code=$v&p=$p'>";
    }
    ?>
    <input type="text" name="verification" size="16" maxlength="6" class="form"><br>
    </fieldset>
    Last edited by jl9148; 11-14-2006 at 11:53 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Location
    Finland, Hollola
    Posts
    285
    Thanks
    8
    Thanked 0 Times in 0 Posts
    I'm not sure but I think you cannot put GET variables in img src tag... or can you?

    Instead of
    Code:
    $new_string = $_GET[ code];
    try putting
    Code:
    $new_string = "lets see if this outputs";
    PHP 5 & MySQL 5 (Y)


  •  

    Posting Permissions

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