Jump to content

captcha help


jl9148

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.