loadTemplateFile("mailform.htm",TRUE,TRUE); $tpl->setVariable(array("dummy"=>"")); $tpl->show(); } elseif($_POST['button']=="確認する"){ while(list($key,$val) = each($_POST)){ $val=ereg_replace("<","<",$val); $val=ereg_replace(">",">",$val); $val=ereg_replace("&","&",$val); $val=ereg_replace("\'","'",$val); $data[$key]=ereg_replace("\"",""",$val); } if(strlen($data['naiyo'])==0){ echo "

連絡内容が入力されていません

"; exit; } $tpl->loadTemplateFile("check.htm"); $tpl->setVariable(array( "youken"=>nl2br($data['youken']), "youken_"=>$data['youken'], "name"=>nl2br($data['name']), "name_"=>$data['name'], "email"=>nl2br($data['email']), "email_"=>$data['email'], "naiyo"=>nl2br($data['naiyo']), "naiyo_"=>$data['naiyo'] )); $tpl->show(); } elseif($_POST['button']=='送信します'){ mb_language("Japanese"); while(list($key,$val) = each($_POST)){ $val=ereg_replace("<","<",$val); $val=ereg_replace(">",">",$val); $val=ereg_replace("&","&",$val); $val=ereg_replace("'","\'",$val); $data[$key]=ereg_replace(""","\"",$val); } $info = "ご用件:".$data['youken']."\n" ."お名前:".$data['name']."\n" ."メールアドレス:".$data['email']."\n" ."連絡内容:".$data['naiyo']."\n"; $jikan=date(Y)."/".date(m)."/".date(d)."(".date(D).") " .date(H).":".date(i).":".date(s); $mailinfo2 = $info ."\n=========================================================\n" ."送信日    :".$jikan."\n" ."リモートホスト:".getenv("REMOTE_HOST")."\n" ."IPアドレス :".getenv("REMOTE_ADDR")."\n" ."ブラウザ   :".getenv("HTTP_USER_AGENT")."\n"; // $mail_body=i18n_ja_jp_hantozen(i18n_convert($mailinfo2,"JIS","Shift_JIS"),"KV","JIS"); $mail_body=mb_convert_kana(mb_convert_encoding($mailinfo2,"JIS","Shift_JIS"),"KV","JIS"); $Subject='=?ISO-2022-JP?B?'.base64_encode(mb_convert_encoding($Subject,"JIS","Shift_JIS")); mail ($To,$Subject,$mail_body,"FROM: ".$From); //thanks.htmlの表示 $tpl->loadTemplateFile("thanks.htm"); $tpl->setVariable(array("dummy"=>"")); $tpl->show(); }