「confirm.html」と「result.html」を共通化する為のモノです。
ウェブページ
- お問い合わせフォームは、同じ様にウェブページで作成します。
この時にフォルダを作り「index.html」としておきます。
【注意】action="confirm.php" → action="confirm.html" - 空ページに「confirm.html」と「resilt.html」を作成する
- sendmailは、各「sendmail」フォルダ内に「○○○○.php」で作る
MovableTypeやJSに関する私的メモの様なモノです。 その中でも皆さんの参考になれば幸いです。 本サイトの管理者は、これらの情報をあなたが利用することによって生ずるいかなる損害に対しても一切責任を負いません。
<div id="wrap_formbox">
<div id="formbox">
<form method="post" action="confirm.php">
<table>
<tr>
<th>プルダウン</th>
<td>
<select name="title">
<option value="項目1">項目1</option>
<option value="項目2">項目2</option>
<option value="項目3">項目3</option>
</select></td>
</tr>
<tr>
<th>テキストエリア</th>
<td><textarea name="comment" cols="60%" rows="5"></textarea></td>
</tr>
<tr>
<th>チェック項目</th>
<td>
<input name="check[]" value="チェック1" type="checkbox" />チェック1
<input name="check[]" value="チェック2" type="checkbox" />チェック2
</td>
</tr>
<tr>
<th>名前 <span style="color:#FF0000;">※</span></th>
<td><input style="width: 60%;" type="text" name="name" /></td>
</tr>
<tr>
<th>郵便番号</th>
<td><input style="width: 20%;" type="text" name="zip1" /></td>
</tr>
<tr>
<th>住所</th>
<td><input style="width: 80%;" type="text" name="add" /></td>
</tr>
<tr>
<th>電話番号</th>
<td><input style="width: 50%;" type="text" name="tel" /></td>
</tr>
<tr>
<th>Email <span style="color:#FF0000;">※</span></th>
<td><input style="width: 80%;" type="text" name="email" /></td>
</tr>
</table>
<div class="center"><p><input value="送信確認" type="submit" name="preview_sys" /></p></div>
</form>
</div>
</div>
<?php session_cache_limiter('private_no_expire'); session_start(); ?>
<!-- ↑ページ最上部に設置 -->
<div id="wrap_formbox">
<div id="formbox">
<h2>送信確認</h2>
<?php include ('sendmail.php'); ?>
<p><?php echo $explain; ?></p>
<form action="result.php" method="post">
<table><?php confirm(); ?></table>
<div class="center"><p><?php submit(); ?></p></div>
</form>
</div>
</div>
<?php session_cache_limiter('private_no_expire'); session_start(); ?>
<!-- ↑ページ最上部に設置 -->
<div id="wrap_formbox">
<div id="formbox">
<h2>送信完了</h2>
<?php include ('sendmail.php'); ?>
<p><?php transmited(); ?></p>
<p class="center"><input type="button" onclick="location.href='/'" value="ホームへ" /></p>
</div>
</div>
@charset "utf-8";
#wrap_formbox {width:100%;}
#formbox {width:780px; margin:0 auto;}
#formbox table{width:100%; background:#f3f2ef; border-collapse:collapse;}
#formbox th, #formbox td{padding:5px 10px; border:1px solid #c8c8c8;}
#formbox th{width:30%;}
.center{text-align:center;}