Webnet77 Christian web host

Hosting Packages

Up to 40 GB storage!
Up to 200GB Traffic!


web hosting

Generic Form Mailer


Form Mailer is a generic Perl Script which will enable you to

  • Process just about any form from your website,
  • Validate the form online before allowing it to be sent,
  • Show the user what data he will be sending before he clicks,
  • Email the contents of the form to you,
  • Redirect the user to a specific destination depending on data in the form,
  • Pass parameters to the destination URL.
The Script also has security features to prevent others from hijacking your SMTP server.

  • Forms can have as many or as few fields as you want,

  • Your email address is never embedded in the form - not even in a hidden field!
  • Each form can have the script redirect to a different URL,
  • The URL to be directed to is not in the form but in the script (security)
  • Numerous security features built into Script.
  • Debug feature.

Server Requirements:
  • A *NIX server (Linux, UNIX etc) with Perl 5.006 or later installed,

  • Access to your cgi-bin directory,

  • A HTML form you wish to process.


Limited help is available at the forum

Question: I am trying to control the order of the output of the form. I thought that the output would show up in the same order as the form that I create, but it seems to show up in a random order. Is there any way to control the order in which each field appears in the email that is generated by the form?

Answer: You can order the output sorted by field name. Change the following code.

Original code

sub check_fields{
my $error;
my $line;

foreach $line(keys %IN){
if ($line ne "submit"){
if (($IN{$line} eq "NO") or ($IN{$line} eq "")){

New Code

sub check_fields{
my $error;
my $line;

my @list = sort {uc($a) cmp uc($b)}(keys %IN);

foreach $line (@list){
if ($line ne "submit"){
if (($IN{$line} eq "NO") or ($IN{$line} eq "")){

More sort options (replace the blue line of code above):

my @list = sort {uc($a) cmp uc($b)}(keys %IN); #-> Alpha ascending, ignore case
my @list = sort {uc($b) cmp uc($a)}(keys %IN); #-> Alpha, descending, ignore case
my @list = sort {($a) cmp ($b)}(keys %IN);     #-> Alpha, ascending, case sensitive
my @list = sort {$a <=> $b}(keys %IN);         #-> Numeric sort, ascending



Click here to download.

Copyright 2002- Webnet77.com. All Rights reserved.