#!/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/pw-driving.co.uk/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/pw-driving.co.uk/public_html/contact/img"; # This directory is the same as above, but using the web accessible # URL path. my $image_dir = "/contact/img"; # This should be the location of the FormMail.cgi script. my $formmail = "/contact/FormMail.cgi"; # This is where the user should be taken to after submitting the form. my $redirect = "http://pw-driving.co.uk/contact/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 = 'Contact PW Driving' ; my $recipient = 'lessons\@pw-driving.co.uk' ; my $invitation = ' Please enter your name, your email address, a subject, your message, and the code for humans in the boxes 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. We shall get back to you as soon as possible. ' ; my $email ; my $realname ; print $cgi->header () ; print << "END_OF_HTML"; Contact PW Driving

Contact PW Driving

Please enter your name, your email address, a subject, your message, and the code for humans in the boxes 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. We shall get back to you as soon as possible.

 

END_OF_HTML