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


In reply to Getting Info from a Form to an Email by Attila1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.