Browse Source

subdivided address field, hopefully fixed mail encoding

svn path=/trunk/; revision=24324
paul 8 years ago
3 changed files with 35 additions and 14 deletions
  1. +23
  2. +1
  3. +11

+ 23
- 11
cgi-bin/ View File

@ -9,30 +9,43 @@ my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
my $reference = "order.$date." . substr $time, -5;
my $firstname = $query->param("firstname");
# technically we only need the last name for shipping
my $firstname = $query->param("firstname") || $firstname = '';
my $lastname = $query->param("lastname");
my $email = $query->param("email");
my $address = $query->param("address");
my $street = $query->param("street");
my $city = $query->param("city");
my $country = $query->param("country");
#my $address = $query->param("address");
my $specifics = $query->param("specifics");
my $comment = $query->param("comment");
my $lang = $query->param("language");
if (
# validate input (more or less)
($firstname or $lastname)
and $email
and $address
and $street
and $city
and $country
# and $address
and $specifics
and not $query->param("url")
) {
#send mail
open(MAIL, "|/usr/lib/sendmail -t -f promoorder\");
open(MAIL, "|/usr/lib/sendmail -t -f $email");
print MAIL
"From: promoorder\
"Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
From: $email
To: assist\
Cc: paul\
Subject: $reference $firstname $lastname
Subject: [promo order] $reference $firstname $lastname
Hey, someone ordered promotional material:
First Name: $firstname
@ -40,7 +53,9 @@ Last Name: $lastname
EMail: $email
Specifics of the Order:
@ -49,9 +64,6 @@ Comments:
Preferred language was: $lang
Your friendly automatic web order program.
close MAIL;

+ 1
- 1
order/orderpromo-error.en.xhtml View File

@ -9,7 +9,7 @@
<h1>Ooops, there is something wrong with your input!</h1>
Please make sure you entered your name, email, address, and the order itself. Comments are optional.
Please make sure you entered your last name, email, full address, and the order itself. Comments are optional.

+ 11
- 2
order/promopack.en.xhtml View File

@ -40,8 +40,17 @@ in general we just send packages up to 1kg. If you need more, please ask.</p>
<input type="text" name="lastname" placeholder="Last Name" size="20" /><br/>
<span class="formlabel">Email:</span>
<input type="text" name="email" placeholder="Email" size="40" /><br/>
<span class="formlabel">Address:</span>
<textarea name="address" rows="4" cols="40"></textarea><br/>
<span class="formlabel">Street, No.:</span>
<input type="text" name="street" size="40" /><br/>
<span class="formlabel">Zip, City:</span>
<input type="text" name="city" size="40" /><br/>
<span class="formlabel">Country:</span>
<input type="text" name="country" size="40" /><br/>
<!-- span class="formlabel">Address:</span>
<textarea name="address" rows="4" cols="40"></textarea><br/ -->
<span class="formlabel">I would like the promotion package to focus on:</span>
<textarea name="specifics" rows="6" cols="40">
No focus, just send me the default package, containing: