Hugeusrealus has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use warnings; use CGI; use Jcode; use DBI; use HTML::Template; use MIME::Base64; require 'jcode.pl'; $| = 1; #unbuffer output $CGI::DISABLE_UPLOADS = 1; # no file uploads - DoS Attack countermeas +ure print "Content-Type: text/html\n\n" ; my $error; # Get the input from the user my $query = new CGI; # set up the database connection my $db = 'test_db'; my $dbhost = '127.0.0.1'; my $dbuser = 'zyxuser'; my $dbpass = 'xyzpass'; my $dbh = DBI->connect("dbi:mysql:$db:$dbhost",$dbuser,$dbpass) + or print qq("COULD NOT INITIALIZE DATABASE $DBI::errstr"); ############################# Start Programing define variables####### +########## my $camp_id = $query->param('camp_id'); my $user_id = $query->param('user_id'); my $email = $query->param('email'); my $name = $query->param('name'); my $zip1 = $query->param('zip1'); my $zip2 = $query->param('zip2'); my $prefect = $query->param('prefect'); my $city = $query->param('city'); my $street = $query->param('street'); my $ADSL = $query->param('ADSL'); my $intrest1 = $query->param('intrest1'); my $intrest2 = $query->param('intrest2'); my $intrest3 = $query->param('intrest3'); my $do_this = $query->param('do_this'); my $do_that = $query->param('do_that'); my $zip = "$zip1-$zip2"; my $intrest = "$intrest1-$intrest2-$intrest3"; my $reply_to = "info\@myhouse.co.jp"; my $subject = q(=?iso-2022-jp A JIS ENCODED subje +ct THAT WORKS==?=);; my $body =q( お世話になっております。 後ほどスタッフよりご連絡させていただきます。); ######## Edited out template part for brevity######### my $mail = qq(To: $email Reply-to: $reply_to From: $reply_to Subject: $subject Content-type: text/plain; charset="ISO-2022-JP" Content-transfer-encoding: 7bit Status: $name 様 $body ); open(MAIL,"| sendmail -t") || die "can't pipe to sendmail"; print MAIL $mail; close(MAIL);
Readmore tags added by davido per consideration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing text Encoding EUC Shift-Jis
by PodMaster (Abbot) on Jan 24, 2005 at 08:34 UTC | |
by Hugeusrealus (Initiate) on Jan 24, 2005 at 11:07 UTC | |
by PodMaster (Abbot) on Jan 24, 2005 at 11:48 UTC |