#!/usr/local/bin/perl use strict; use warnings; use lib qw(./lib); use Encode; use encoding 'euc-jp'; use CGI; use IO::File; use IO::Pipe; use HTML::FillInForm; use Data::Dumper; use MIME::Base64; #print "Content-Type: text/plain; charset=EUC-JP\n\n"; #print "Content-Type: text/html; charset=EUC-JP\n\n"; #my $sendmail = '/usr/sbin/sendmail -t'; my $sendmail = '/usr/lib/sendmail -t'; my $template = 'entry.html'; my $errors = []; my $query = CGI->new; foreach my $p($query->param) { my @v = map {Encode::decode('euc-jp',$_)} $query->param($p); $query->param($p,@v); } my $required = [['lname', '姓'], ['fname', '名'], ['lname_kana', 'セイ'], ['fname_kana', 'メイ'], ['email', 'メールアドレス'], ['pref', '都道府県'], ['sex', '性別'], ['job', 'ご職業'], ['experience', '取引経験'], ]; foreach my $column(@$required){ my($k, $v) = @$column; push @$errors, $v . 'を入力してください' unless($query->param($k)); } if($query->param('email') ne $query->param('email2')){ push @$errors, "メールアドレスが一致しません"; } unless($query->param('relations')){ push @$errors, "口座の有無を入力してください"; } if(scalar(@$errors) > 0){ my $file = IO::File->new($template, 'r'); my $error_message = '
' . join('
', @$errors) . "