Attila1 has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks I recently took over care of a website that needed extensive updating. I had to add some bidding forms to this site. I use an htm form to place the bid, it in turn accesses a submit.pl form that sends the bid where it is supposed to go. The problem I am having is some of the info is duplicated and some is missing. I really wish I understood this stuff better but I don't and I need the form up real soon. Can some one help me please? Here is the present code:
my $from = $cgi->param('Email'); { &CheckRequired ($cgi, $required); foreach (@recipients) { open (MAIL, "|$sendmail $_"); print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; print MAIL $cgi->param("Name"); print MAIL $cgi->param("Employee Number"); print MAIL $cgi->param("Seniority Number"); print MAIL $cgi->param("Home Terminal"); print MAIL $cgi->param("RdYd"); print MAIL $cgi->param("Email"); print MAIL $cgi->param("Bid1"); print MAIL $cgi->param("Craft1 +"); foreach (@data){ chomp; my ($key, $name, $type) = split /\|/; next if ($cgi->param($key) eq ""); if ($type eq "multi") { print MAIL "$name: ", join (", ", $cgi->param($key)), +"\n"; } elsif ($type eq "single") { print MAIL "$name: ", $cgi->param($key), "\n"; print MAIL "\n" if ($key eq "Email"); } } #print MAIL "Whatever you want to say."; my $now = localtime; print MAIL "Submitted: $now\n"; close MAIL; } print $cgi->redirect ( -url => $redirect ); }
and
__DATA__ Name|Name|single Employee Number|Employee Number|single Seniority Number|Seniority Number|single Home Terminal|Home Terminal|single RdYd|Road/Yard|single Email|Email|single 1|Bid 1|single 2|Bid 2|single 3|Bid 3|single 4|Bid 4|single 5|Bid 5|single
The received email that I get looks like this:
Attila1 555555 154 Terminal 25 Yard Work attila@shaw.ca Trmn Name: Attila Employee Number: 555555 Seniority Number: 154 Home Terminal: Terminal 25 Road/Yard: Yard Work Email: attila@shaw.ca Bid 1: Terminal 25 Swt Bid 2: West Pool Bid 3: South Pool Submitted: Mon Sep 27 09:29:14 2004
I want the email that i get to look like this:
Major terminal Weekly Bid Name: Attila Employee Number: 555555 Seniority Number: 154 Home Terminal: Terminal 25 Road/Yard: Yard Work Email: attila@shaw.ca Bid 1: Terminal 25 Swt Craft: Yf Bid 2: West Pool Craft: YH Bid 3: South Pool Craft: ST Submitted: Mon Sep 27 09:29:14 2004
Any help would be greatly appreciated. Thanks Monks.

20040928 Janitored by Corion: Put code in readmore tags

Replies are listed 'Best First'.
•Re: Getting Info from a Form to an Email
by merlyn (Sage) on Sep 27, 2004 at 17:58 UTC
Re: Getting Info from a Form to an Email
by Zed_Lopez (Chaplain) on Sep 27, 2004 at 21:17 UTC
Re: Getting Info from a Form to an Email
by Attila1 (Initiate) on Sep 27, 2004 at 22:37 UTC
    Thanks Guys, both options look like they will address the duplicated values problem buth I don't see how they will solve the to values on the same line issue? Altho I will be the first to admit that I know very little of this stuff. I cannot change formats, form must remain as a pl file since we are part of a 5 union labour site, everything is set up as pl's. I was hoping for a fast easy fix as the forms are needed by the end of the month, guess it is not to be. Thanks any way guys, I'll return when I learn a lot more about perl and cgi.