#! /usr/local/bin/perl #################################################################### # メイングラム名: ネットクルーズIP接続移行申込みフォーム # # サブグラム名: ipikoo.cgi           # # このプログラムを無断で転用販売することを禁じます。 # # copyright:ichiroo kawamoto # # 作成日付:99/05/06 # # 修正日付:99/05/06 # #################################################################### require "jcode.pl"; require "cgi-lib.pl"; require "henkan.pl"; require "syubetu.pl"; require "chkemail.pl"; require "shoki.pl"; &ReadParse; srand; $rand = int(rand(10000000000)); @dd = split(/&/,$ENV{'QUERY_STRING'}); $dd[0] = $rand; $ddd = $ENV{'QUERY_STRING'}; ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime; if ($year > 50) {$year = "19" . $year;} else {$year = "20" . $year;} $mon++; @week = ("日","月","火","水","木","金","土"); $wday = $week[$wday]; $time = "$mon月$mday日($wday)$hour時$min分$sec秒"; $YUUBIN1 = $in{"YUUBIN1"}; $YUUBIN2 = $in{"YUUBIN2"}; $ADDRESS = $in{"ADDRESS"}; $NAME = $in{"NAME"}; $NAME2 = $in{"NAME2"}; $STEL = $in{"STEL"}; $TEL = $in{"TEL"}; #$STEL2 = $in{"STEL2"}; #$TEL2 = $in{"TEL2"}; $MAIL = $in{"MAIL"}; ################################# ファイル書き込み ###################################### if ($in{"KAKUTEI2"} eq "確定"){ if (-d "data" ne 1){ mkdir("data",0777); chmod(0777,"data"); } if (-e "data/data.txt" ne 1){ open(OUT,">data/data.txt"); close(OUT); } else{ #### 重複チェック ##### $atta = 0; open(IN,"data/data.txt"); $konma = ','; for ($i = 0;$i < 100000;$i++){ $line = ; if ($line eq ""){last;} @line = split(/$konma/,$line); if (($line[0] eq $HNAME && $line[10] eq $TEL1) || ($line[1] eq $NAME && $line[10] eq $TEL1)){ $atta = 1; last; } } close(IN); if ($atta eq 1){ print "Content-type: text/html\n\n"; print"\n"; print"\n"; print'IP接続移行申込みフォーム入力エラー'."\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print'IP接続移行申込みフォーム入力エラー'."
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"同一データが既に存在します。

\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"プラウザの[戻る]キーで戻ってフォーム内容を修正して下さい。\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; exit(); } } open(IN,"data/data.txt"); open(OUT,">data/temp.txt"); flock(OUT,2); print OUT $NAME.','; print OUT $STEL.','; print OUT $TEL.','; print OUT $MAIL.','; print OUT "\n"; for ($i = 0;$i < 100000;$i++){ $line = ; if ($line eq ""){last;} print OUT $line; } flock(OUT,8); close(OUT); close(IN); rename("data/temp.txt","data/data.txt"); chmod (0777,"data/data.txt"); print "Content-type: text/html\n\n"; print"\n"; print"\n"; print'フォーム入力終了画面'."\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print'フレッツISDN用接続への移行申込みありがとうございます!!'."
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; &make_message($MAIL,'webmaster@netcruise.co.jp',$msg); &make_message($to_email,'webmaster@netcruise.co.jp',$msg2); print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"フォーム内容は、送信されました。
\n"; print"確認後、郵送にてフレッツISDN接続用のIDとパスワードをお送りさせていただきます。
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; exit(); } ################################# 入力フォーム確認 ###################################### if ($in{"KAKUTEI"} eq "確定"){ #print "Content-type: text/html\n\n"; #print"\n"; # 左右の空白を削除 $YUUBIN1 = &henkan'kuuhaku($YUUBIN1); $YUUBIN2 = &henkan'kuuhaku($YUUBIN2); $ADDRESS = &henkan'kuuhaku($ADDRESS); $NAME = &henkan'kuuhaku($NAME); $NAME2 = &henkan'kuuhaku($NAME2); $STEL = &henkan'kuuhaku($STEL); $TEL = &henkan'kuuhaku($TEL); # $STEL2 = &henkan'kuuhaku($STEL2); # $TEL2 = &henkan'kuuhaku($TEL2); $MAIL = &henkan'kuuhaku($MAIL); # 文字中の空白を削除 $YUUBIN1 = &henkan'kuuhaku2($YUUBIN1); $YUUBIN2 = &henkan'kuuhaku2($YUUBIN2); $ADDRESS = &henkan'kuuhaku2($ADDRESS); $NAME = &henkan'kuuhaku2($NAME); $NAME2 = &henkan'kuuhaku2($NAME2); $STEL = &henkan'kuuhaku2($STEL); $TEL = &henkan'kuuhaku2($TEL); # $STEL2 = &henkan'kuuhaku2($STEL2); # $TEL2 = &henkan'kuuhaku2($TEL2); $MAIL = &henkan'kuuhaku2($MAIL); # 文字中の"-","−"を削除 $TEL = &henkan'haihun($TEL); # $TEL2 = &henkan'haihun($TEL2); $p = 0; $atta = 0; @err = ""; #### 重複チェック ##### open(IN,"data/data.txt"); $konma = ','; for ($i = 0;$i < 100000;$i++){ $line = ; if ($line eq ""){last;} @line = split(/$konma/,$line); if (($line[0] eq $NAME && $line[2] eq $TEL) || $line[2] eq $TEL || ($line[3] eq $MAIL && $MAIL ne "")){ $err[$p] = 'あなたのデータは既に登録済みです。'; $p++; $atta = 1; last; } } close(IN); # 必須エラー調査 if ($YUUBIN1 eq ""){$err[$p] = '郵便番号が記入されていません。';$p++;$atta = 1;} if ($ADDRESS eq ""){$err[$p] = 'ご住所が記入されていません。';$p++;$atta = 1;} if ($NAME eq ""){$err[$p] = 'お名前(漢字)が記入されていません。';$p++;$atta = 1;} if ($NAME2 eq ""){$err[$p] = 'お名前(カナ)が記入されていません。';$p++;$atta = 1;} if ($STEL eq ""){$err[$p] = '電話番号市外局番が記入されていません。';$p++;$atta = 1;} if ($TEL eq ""){$err[$p] = '電話番号が記入されていません。';$p++;$atta = 1;} # if ($STEL2 eq ""){$err[$p] = 'IP接続電話番号市外局番が記入されていません。';$p++;$atta = 1;} # if ($TEL2 eq ""){$err[$p] = 'IP接続電話番号が記入されていません。';$p++;$atta = 1;} if ($atta ne 1){ # 全角漢字以外はエラー、数字、記号もだめ $atta2 = 0; if (index(&syubetu'syubetu1($NAME),'記号') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($NAME),'数字') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($NAME),'半角') >= 0){$atta = 1;$atta2 = 1;} if ($atta2 eq 1){$err[$p] = 'お名前(漢字)が正しく記入されていません。';$p++;} $atta2 = 0; if (index(&syubetu'syubetu1($NAME2),'記号') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($NAME2),'数字') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($NAME2),'半角') >= 0){$atta = 1;$atta2 = 1;} if ($atta2 eq 1){$err[$p] = 'お名前(カナ)が正しく記入されていません。';$p++;} # 数字以外はエラー $atta2 = 0; if (index(&syubetu'syubetu1($STEL),'英') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($STEL),'カタカナ') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($STEL),'ひらがな') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($STEL),'記号') >= 0){$atta = 1;$atta2 = 1;} if (length($STEL) > 4 || length($STEL) < 2){$atta = 1;$atta2 = 1;} if (index(&syubetu'syubetu1($TEL),'英') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($TEL),'カタカナ') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($TEL),'ひらがな') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($TEL),'記号') >= 0){$atta = 1;$atta2 = 1;} if (length($TEL) > 8 || length($TEL) < 6){$atta = 1;$atta2 = 1;} if ($atta2 eq 1){$err[$p] = '連絡先電話番号が正しく記入されていません。';$p++;} # $atta2 = 0; # if (index(&syubetu'syubetu1($STEL2),'英') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($STEL2),'カタカナ') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($STEL2),'ひらがな') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($STEL2),'記号') >= 0){$atta = 1;$atta2 = 1;} # if (length($STEL2) > 4 || length($STEL2) < 2){$atta = 1;$atta2 = 1;} # # if (index(&syubetu'syubetu1($TEL2),'英') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($TEL2),'カタカナ') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($TEL2),'ひらがな') >= 0){$atta = 1;$atta2 = 1;} # elsif (index(&syubetu'syubetu1($TEL2),'記号') >= 0){$atta = 1;$atta2 = 1;} # if (length($TEL2) > 8 || length($TEL2) < 6){$atta = 1;$atta2 = 1;} # # if ($atta2 eq 1){$err[$p] = 'IP接続電話番号が正しく記入されていません。';$p++;} # 半角英小文字、"-" 記号以外はエラー if ($MAIL ne ""){ $atta2 = 0; if (index(&syubetu'syubetu1($MAIL),'全角') >= 0){$atta = 1;$atta2 = 1;} elsif (index(&syubetu'syubetu1($MAIL),'カタカナ') >= 0){$atta = 1;$atta2 = 1;} elsif (index($MAIL,'@') < 0){$atta = 1;$atta2 = 1;} if ($atta2 eq 1){$err[$p] = 'メールアドレスが正しく記入されていません。';$p++;} } } #print"j=$j"; if ($atta eq 1){ print "Content-type: text/html\n\n"; print"\n"; print"\n"; print'フォーム入力エラー'."\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print'フォーム入力エラー'."
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; for ($p = 0;$p < 5;$p++){ if ($err[$p] eq ""){last;} print"$err[$p]

\n"; } if ($err[$p] ne ""){print"その他にもエラー有り
\n";} print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"プラウザの[戻る]キーで戻ってフォーム内容を修正して下さい。\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; exit(); } print "Content-type: text/html\n\n"; print"\n"; print"\n"; print'フレッツISDN用接続への移行申込み内容確認'."\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print'フレッツISDN用接続への移行申込み内容確認'."\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; # print"\n"; # print"\n"; # print"\n"; # print"\n"; # print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
郵便番号\n"; if ($YUUBIN1 ne "" || $YUUBIN2 ne ""){ print"\n"; print "$YUUBIN1-$YUUBIN2"; print"\n"; } else{ print" "; } print"
ご住所\n"; if ($ADDRESS ne ""){ print"\n"; print $ADDRESS; print"\n"; } else{ print" "; } print"
お名前(漢字)\n"; if ($NAME ne ""){ print"\n"; print $NAME; print"\n"; } else{ print" "; } print"
お名前(カナ)\n"; if ($NAME2 ne ""){ print"\n"; print $NAME2; print"\n"; } else{ print" "; } print"
電話番号\n"; if ($STEL ne "" || $TEL ne ""){ print"\n"; print"$STEL-$TEL"; print"\n"; } else{ print" "; } print"
IP接続電話番号\n"; # if ($STEL2 ne "" || $TEL2 ne ""){ # print"\n"; # print"$STEL2-$TEL2"; # print"\n"; # } # else{ # print" "; # } # print"
メールアドレス\n"; if ($MAIL ne ""){ print"\n"; print $MAIL."\n"; print"\n"; } else{ print" "; } print"
\n"; print"\n"; print"
\n"; print"\n"; print"
\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; #print"\n"; #print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; exit(); } print "Content-type: text/html\n\n"; print"\n"; print"\n"; print'NTTフレッツISDN用接続への移行申込み'."\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print'NTTフレッツISDN用接続への移行申込み'."\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print'●既にネットクルーズの通常電話回線接続をご利用のお客様で、NTT'."\n"; print'フレッツISDN用接続(つなぎ放題、電話代定額)をご利用される'."\n"; print'場合は、このフォームでお申し込み下さい。
'."\n"; print'確認後、新しいフレッツISDN接続用のIDとパスワードを発行し、メール'."\n"; print'にて返信いたします。'."\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print'※この申し込みは、NTTよりフレッツISDNサービスが受けられる回線であることが必要です。
'."\n"; print'NTT窓口へフレッツISDNサービスをお申し込みになり、フレッツISDNサービスの工事を完了してから'."\n"; print'このフォームでお申し込み下さい。
'."\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print' お申込内容記入欄'."\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; #print"\n"; #print"\n"; #print"\n"; #print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
郵便番号(必須入力)
\n"; print"-\n"; print"\n"; print"
ご住所(必須入力)
\n"; print"\n"; print"
お名前(漢字)(必須入力)
\n"; print"\n"; print"
お名前(カナ)(必須入力)
\n"; print"\n"; print"
連絡先電話番号(必須入力)
\n"; print"市外局番-\n"; print"
IP接続電話番号(必須入力)
\n"; #print'NTTへフレッツISDNをお申し込みの時、
NTTより通知されます。
'."\n"; #print"
\n"; #print"市外局番-\n"; #print"
Eメールアドレス\n"; print"\n"; print"
\n"; print"
\n"; print"\n"; print"
\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"\n"; print"
\n"; print"
\n"; print"
\n"; print"\n"; print"\n"; exit(); sub make_message{ local($TO_EMAIL,$EMAIL,$BUN) = @_; $sendmail = `which sendmail`; chop($sendmail); if (index($sendmail,'/sendmail') < 0){ $sendmail = `which mail`; chop($sendmail); } $message = ''; $message = $message . "From:$EMAIL\n"; $message = $message . "To:$TO_EMAIL\n"; $message = $message . 'Subject:ネットクルーズフレッツISDN接続移行フォームよりの通知'."\n"; #$message = $message . 'Name:wooman.jpg'."\n"; #$message = $message . "Type:JPEG Image (image/jpeg)\n"; #$message = $message . "Encoding:base64\n"; $message = $message . $BUN; $message = $message . "\n"; $message = $message . "<入力内容>\n"; $message = $message . 'フレッツISDN接続移行申込み希望'."\n"; $message = $message . "郵便番号:$YUUBIN1-$YUUBIN2\n"; $message = $message . "ご住所:$ADDRESS\n"; $message = $message . "お名前(漢字):$NAME\n"; $message = $message . "お名前(カナ):$NAME2\n"; $message = $message . "電話番号:$STEL-$TEL\n"; #$message = $message . "IP接続電話番号:$STEL2-$TEL2\n"; $message = $message . "メールアドレス:$MAIL\n"; $message = $message . "\n"; #print "sendmail=$sendmail
\n"; &jcode'convert(*message,'jis'); $err = ""; $err = open (MAIL,"|$sendmail $TO_EMAIL"); print MAIL $message; close (MAIL); return $err; }