Thanks for your replies...I haven't been here in a longgg...time...:)
Here is the code I used from the referenced link except WITH the '$number_of_characters' var pre-defined:
#!/usr/bin/perl -w -d
use Authen::Captcha;
# create a new object
my $captcha = Authen::Captcha->new();
# set the data_folder. contains flatfile db to maintain state
$captcha->data_folder('/usr/home1/user123/public_html/folder01')
+;
# set directory to hold publicly accessable images
$captcha->output_folder('/usr/home1/user123/public_html/folder01
+/images');
# I created this variable's value
my $number_of_characters = 6;
# create a captcha. Image filename is "$md5sum.png"
my $md5sum = $captcha->generate_code($number_of_characters);
# check for a valid submitted captcha
# $code is the submitted letter combination guess from the use
+r
# $md5sum is the submitted md5sum from the user (that we gave
+them)
my $results = $captcha->check_code($code,$md5sum);
# $results will be one of:
# 1 : Passed
# 0 : Code not checked (file error)
# -1 : Failed: code expired
# -2 : Failed: invalid code (not in database)
# -3 : Failed: invalid code (code does not match crypt)
##############
Let me know if you need additional info.
Thanks.
EDIT: changed above: '$number_of_characters = 6;' to 'my $number_of_characters = 6;'
(haven't edited a Perl script much recently either...) |