#!/usr/bin/perl use strict; use warnings; use Authen::Captcha; use CGI ; my $cgi = new CGI ; # this directory is not accessible via the web. my $captcha_datadir = "/home/sites/fire-genie.com/public_html/../.captcha_data"; # this directory will store the captcha images. This should # be accessible via the web because it will be included on the page. my $captcha_outputdir = "/home/sites/fire-genie.com/public_html/form/img"; # This directory is the same as above, but using the web accessible # URL path. my $image_dir = "/form/img"; # This should be the location of the FormMail.cgi script. my $formmail = "/form/FormMail.cgi"; # This is where the user should be taken to after submitting the form. my $redirect = "http://fire-genie.com/form/email_sent.html"; my $captcha = Authen::Captcha->new( data_folder => $captcha_datadir, output_folder => $captcha_outputdir, ); my ($md5sum, $chars) = $captcha->generate_code(4); # eliminate ambiguous chars from $chars my $bad_chars = 1; while ($bad_chars) { if ( $chars =~ m/o|0|O|l|i|1|q|9|6|b|s|S|5|2|Z/) { ($md5sum, $chars) = $captcha->generate_code(4); } else { $bad_chars = 0; } } my $title = 'FireGenie Contact us Form' ; my $recipient = 'francis\@fire-genie.com' ; my $invitation = ' Please enter your name, your email address, Your Contact Number and your address, and the code number in the box and click send. We apologise for asking you to enter a code but it blocks those electronic robots from clogging up our mailbox with spam. Thank you. ' ; my $email ; my $realname ; print $cgi->header () ; print << "END_OF_HTML";
Please enter your name, your email address, Your Contact Number and your address, and the code number in the box and click send. We apologise for asking you to enter a code but it blocks those electronic robots from clogging up our mailbox with spam. Thank you.
END_OF_HTML