...

View Full Version : CAPTCHA help!



jl9148
11-14-2006, 10:50 PM
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
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

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

kaisellgren
11-15-2006, 09:01 PM
I'm not sure but I think you cannot put GET variables in img src tag... or can you?

Instead of
$new_string = $_GET[ code]; try putting
$new_string = "lets see if this outputs";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum