<%@ Language=VBScript %> <%option explicit%> <% '********************************************************************************************************************************** '* メールフォーム[フォーム] '********************************************************************************************************************************** '* '* 準備 '* '********************************************************************************************************************************** '---------------------------------------------------------------------------------------------------------------------------------- ' 共通設定ファイルの読み込み '---------------------------------------------------------------------------------------------------------------------------------- %><% '---------------------------------------------------------------------------------------------------------------------------------- ' 共通関数の読み込み '---------------------------------------------------------------------------------------------------------------------------------- %><% %><% '---------------------------------------------------------------------------------------------------------------------------------- ' 変数の宣言 '---------------------------------------------------------------------------------------------------------------------------------- '----コンスト const txtBaseTpPath = "./tp/base.tp" 'テンプレートの設定 const txtMainTpPath = "./tp/inquiry.tp" 'テンプレートの設定 const intKomokuCnt = 7 'エレメント項目数 '----表示関係 dim objBasp 'Basp21 dim objFso 'ファイルシステムオブジェクト dim objBaseTp 'テキストファイル(テンプレート用) dim objMainTp 'テキストファイル(テンプレート用) dim strMainHtml '表示テンプレートMAIN dim strBaseHtml '表示テンプレートBASE '----モード dim flgRet 'ret = 確認画面からの戻り '----入力項目 dim strItemElementAry redim strItemElementAry(intKomokuCnt-1,15) '入力項目の情報を格納する配列 dim strItemInput redim strItemInput(intKomokuCnt-1) 'インプットのHTML '----選択項目に使用する配列 'なし '---------------------------------------------------------------------------------------------------------------------------------- ' 初期設定 '---------------------------------------------------------------------------------------------------------------------------------- 'オブジェクトの用意等 set objBasp = server.createobject("basp21") 'Basp21オブジェクト生成 set objFso = CreateObject("Scripting.FileSystemObject") 'ファイルシステムオブジェクト生成 set objBaseTp = objFso.OpenTextFile(server.MapPath(txtBaseTpPath),1) 'テキストファイルをオブジェクト化 set objMainTp = objFso.OpenTextFile(server.MapPath(txtMainTpPath),1) 'テキストファイルをオブジェクト化 '連投防止フラグ session("mailSendFlg") = "0" 'テンプレートの読み込み strBaseHtml = objBaseTp.readall 'テンプレート strMainHtml = objMainTp.readall 'テンプレート '入力項目の要素を配列に格納 %><% '---------------------------------------------------------------------------------------------------------------------------------- ' 値の取得 '---------------------------------------------------------------------------------------------------------------------------------- '----戻りフラグの取得(1 = 確認画面からの戻り) flgRet = repText(Request("flgRet")) & "" 'inputのvalueに設定する値を取得する select case flgRet case "1" '確認画面からの戻り '----連絡先情報をPOSTから取得してデフォ値にセット call getFrmValueFromPost(strItemElementAry) case else 'デフォルト値なし end select '---------------------------------------------------------------------------------------------------------------------------------- ' 入力項目inputの文字列を生成 '---------------------------------------------------------------------------------------------------------------------------------- strItemInput = makeInputString(strItemElementAry) '********************************************************************************************************************************** '* '* 画面出力 '* '********************************************************************************************************************************** '置換(検索条件部分) call replaceItem() Response.Write strBaseHtml '********************************************************************************************************************************** '* '* ここで使う関数 '* '********************************************************************************************************************************** '---------------------------------------------------------------------------------------------------------------------------------- ' 検索部分の置きかえ '---------------------------------------------------------------------------------------------------------------------------------- private sub replaceItem() strBaseHtml = replace(strBaseHtml,"##MAINHTML##",strMainHtml) strBaseHtml = replace(strBaseHtml,"##CUSTNAME1##",strItemElementAry(0,1)) strBaseHtml = replace(strBaseHtml,"##CUSTNAME##",strItemInput(0)) strBaseHtml = replace(strBaseHtml,"##CUSTMAIL1##",strItemElementAry(1,1)) strBaseHtml = replace(strBaseHtml,"##CUSTMAIL##",strItemInput(1)) strBaseHtml = replace(strBaseHtml,"##CUSTTEL11##",strItemElementAry(2,1)) strBaseHtml = replace(strBaseHtml,"##CUSTTEL1##",strItemInput(2)) strBaseHtml = replace(strBaseHtml,"##CUSTTEL2##",strItemInput(3)) strBaseHtml = replace(strBaseHtml,"##CUSTTEL3##",strItemInput(4)) strBaseHtml = replace(strBaseHtml,"##CUSTJUSHO1##",strItemElementAry(5,1)) strBaseHtml = replace(strBaseHtml,"##CUSTJUSHO##",strItemInput(5)) strBaseHtml = replace(strBaseHtml,"##CUSTTOIAWASE1##",strItemElementAry(6,1)) strBaseHtml = replace(strBaseHtml,"##CUSTTOIAWASE##",strItemInput(6)) strBaseHtml = replace(strBaseHtml,"##BUTTON_L##","") strBaseHtml = replace(strBaseHtml,"##queryStrings##",Request.QueryString) end sub '********************************************************************************************************************************** %>