I've never programmed in Perl/CGI and need help creating a Perl/CGI script. I need an HTML page and a Perl/CGI script that will do the following:
HTML page:
1) Contain a form with five fields ("Title", "Fullname", "EmailAddress" "HomeAddress" and "Textbox"). The Textbox will be where the user types in his message to me.
2) A sixth field where the user will type in the sum of x plus y. (Where x and y are whole numbers). This field should be used to stop spam ie if the user types in the correct value the form is submitted. Also I should be able to change the values of x and y regularly and consequently the "correct acceptable value"
3) Validate the form fields to ensure that they contain the correct data (client-side validation - may be using Javascript)
4) The form will be submitted to a Perl/CGI script.
Upon submission of the HTML form:
1) The user should be directed to a "thank you" page.
2) The user should be automatically e-mailed saying thank you for the form submission and that someone will be in touch shortly.
3) I should be emailed the contents of the form.
The Perl/CGI script will reside on a Unix server.
To send mail using perl scripts, you can use CGI module. I guess that will work. If not, then my other modules installed on the Unix server are:
Acme::Spork (0.0.7
Apache::Admin::Config (0.94)
AppConfig (1.66)
Archive::Tar (1.38)
Archive::Tar::Streamed (0.03)
Archive::Zip (1.23)
Array::Compare (1.14)
Authen::Libwrap (0.20)
BSD::Resource (1.2901)
Business::OnlinePayment (2.01)
Business::OnlinePayment::A
uthorizeNe
t (3.20)
Business::UPS (1.13)
CGI (3.38)
CPAN (1.9205)
Class::Accessor (0.31)
Class::Std (0.0.9)
Class::Std::Utils (0.0.3)
Compress::Bzip2 (2.09)
Compress::Raw::Zlib (2.005)
Compress::Zlib (1.42)
Convert::ASN1 (0.21)
Cpanel::Cleanup (0.4)
Cpanel::FastMath (0.2)
Cpanel::POSIX::Tiny (0.7)
Crypt::GPG (1.63)
Crypt::OpenSSL::RSA (0.25)
Crypt::OpenSSL::Random (0.04)
Crypt::SSLeay (0.57)
Curses (1.14)
Curses::UI (0.9605)
Cwd (3.2501)
DBD::mysql (4.007)
DBI (1.605)
DBIx::MyParsePP (0.50)
Data::Dump (1.08)
DateTime (0.41)
Devel::PPPort (3.14)
Digest::HMAC (1.01)
Digest::MD5 (2.36)
Digest::MD5::File (0.06)
Digest::SHA (5.47)
Digest::SHA1 (2.11)
Email::Date::Format (1.002)
Email::Valid (0.179)
Encode (2.26)
Encode::Detect (1.01)
Error (0.17009)
Expect (1.21)
ExtUtils::CBuilder (0.23)
ExtUtils::MakeMaker (6.44)
ExtUtils::ParseXS (2.19)
File::Copy::Recursive (0.36)
File::Find::Rule (0.30)
File::Find::Rule::Filesys:
:Virtual (1.22)
File::HomeDir (0.80)
File::MMagic::XS (0.09003)
File::ReadBackwards (1.04)
File::Slurp (9999.13)
File::Tail (0.99.3)
File::Temp (0.20)
File::Touch (0.02)
File::Which (0.05)
Filesys::Df (0.92)
Filesys::Statvfs (0.82)
Filesys::Virtual (0.06)
Filesys::Virtual::Plain (0.10)
Filter (1.03)
GD (2.35)
GD::Graph (1.44)
GD::Text (0.86)
Geo::IPfree (0.2)
Getopt::Long (2.37)
Getopt::Param::Tiny (0.5)
Graph::Easy (0.63)
Graph::Flowchart (0.11)
HTML::Parser (3.56)
HTML::Tagset (3.20)
HTTP::Daemon::App (0.0.9)
HTTP::Daemon::SSL (1.02)
IO::Compress::Base (2.005)
IO::Compress::Zlib (2.005)
IO::Socket::ByteCounter (0.0.2)
IO::Socket::SSL (1.13)
IO::Stringy (2.110)
IO::Stty (.02)
IO::Tty (1.07)
IO::Zlib (1.09)
IP::Country (2.25)
IPC::Run (0.80)
Image::Magick (6.4.2)
Image::Size (3.100001)
LWP (5.813)
Lchown (1.00)
List::Cycle (0.04)
List::Util (1.19)
MD5 (2.03)
MIME::Lite (3.021)
MIME::Types (1.22)
MLDBM (2.01) Mail (0.02)
Mail::DKIM (0.32)
Mail::DomainKeys (1.0)
Mail::SPF (v2.005)
Mail::SPF::Query (1.999.1)
Mail::SRS (0.31)
Mail::SpamAssassin (3.002004)
Math::Fibonacci (1.5)
Math::Fibonacci::Phi (0.02)
Module::Build (0.2808)
Net (0.11)
Net::AIM (1.22)
Net::CIDR::Lite (0.20)
Net::DAV::Server (1.29)
Net::DNS (0.63)
Net::DNS::Resolver::Progra
mmable (v0.003)
Net::Daemon (0.43)
Net::Daemon::SSL (1.0)
Net::FTPSSL (0.04)
Net::IP (1.25)
Net::LDAP (0.36)
Net::LDAP::Server (0.4)
Net::OSCAR (1.925)
Net::SSLeay (1.32)
NetAddr::IP ( 4.007)
Number::Compare (0.01)
OLE::Storage_Lite (0.17)
Parse::RecDescent (1.94)
Perl (5.8.8)
Pod::Escapes (1.04)
Pod::Simple (3.05)
Proc::Daemon (0.03)
Quota (1.6.2)
RRDp (1.000481)
RRDs (1.000481)
SQL::Statement (1.15)
SVG::TT::Graph (0.10)
Safe::Hole (0.10)
Set::Crontab (1.00)
Spreadsheet::ParseExcel (0.32)
Spreadsheet::WriteExcel (2.21)
Storable (2.18)
String::CRC32 (1.4)
Sub::Uplevel (0.18)
Sys::Hostname::Long (1.4)
Template (2.19)
Term::ReadKey (2.30)
Term::ReadLine (1.02)
Test::Exception (0.25)
Test::Harness (3.12)
Test::Pod (1.26)
Test::Simple (0.80)
Test::Warn (0.10)
Text::CSV_XS (0.32)
Text::Glob (0.08)
Text::Query (0.07)
Tie::DBI (1.02)
Tie::IxHash (1.21)
Tie::ShadowHash (0.07)
Tie::Watch (1.2)
Time::HiRes (1.9715)
TimeDate (1.01)
Tree::DAG_Node (1.05)
Tree::MultiNode (1.0.10) URI (1.37)
Unix::PID (0.0.15)
Unix::PID::Tiny (0.5)
XML::LibXML (1.66)
XML::LibXML::Common (0.13)
XML::NamespaceSupport (1.09)
XML::Parser (2.34)
XML::SAX (0.16)
XML::SAX::Expat (0.40)
XML::Simple (2.18)
XML::Writer (0.603)
YAML (0.66)
YAML::Syck (1.05)
lib::restrict (0.0.5)
version (0.7501) ()
In order for the Perl/CGI script to work it needs to be in a cgi-bin directory.
Can anyone please help me put this script together? Thank you very much for all your help in advance. I really appreciate your support. I'll appreciate a speedy reply.
Best wishes,
Ashraf