Jump to content

Archived

This topic is now archived and is closed to further replies.

jl9148

captcha help

Recommended Posts

hey, i have a memberscript and when users register, i want them to enter in a captcha code.

the script already comes with that but its not working. below is the code...

[i]verification.php[/i]
[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);
?>[/code]

and here is what i put into the registration page...

[code]<fieldset>
<legend>Image Verification</legend>
<table cellpadding="0" cellspacing="0" class="main"><tr>
<?php
for ( $p = 0; $p <= 5; $p++ ) {
echo "<td><img src='$script_location/verification.php?code=$v&p=$p'></td>";
echo "<td width='5'></td>";
}
?>
<td><input type="text" name="verification" size="16" maxlength="6" class="form"></td>
</tr></table>
</fieldset>[/code]

whenever i try to do that, all that shows up is 5 black blocks..

help anyone? thanks[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.