この内容は古いバージョンです。最新バージョンを表示するには、戻るボタンを押してください。
バージョン:3
ページ更新者:guest
更新日時:2026-06-11 00:16:53

タイトル: $_POST

この本文には実行可能なタグ等が含まれるため、安全のためHTMLソースとして表示しています。本文データは変更していません。

<p>クライアント&rarr;サーバへのデータ送信方法の一つ。</p>

<p>以下、HTMLフォームを送信する方法を記載する。</p>

<p>HTMLのformタグ(method属性で&rdquo;<span style="color:#e74c3c">POST</span>&rdquo;指定)内のaction属性で、受信側のファイルを指定する。</p>

<p>受信側のファイルでは <span style="color:#e74c3c">$_POST[&lsquo;name属性名'] </span>で送信データを受け取る。</p>

<p>以下、実装例。</p>

<p>【例】</p>

<p style="margin-left:40px">『注文画面』</p>

<p style="margin-left:80px"><img alt="" src="/uploadImage/20170809014116_2945120.jpg" /></p>

<p style="margin-left:80px"><html></p>

<p style="margin-left:80px">&nbsp; &nbsp; <body></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; <!-- フォーム通信を実行する --></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; <strong><span style="color:#e74c3c"><form method="POST" action="TestPost.php"></span></strong></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="text" <span style="color:#e74c3c">name="item"</span>></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <input type="submit" value="注文する"></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#e74c3c"><strong></form></strong></span></p>

<p style="margin-left:80px">&nbsp; &nbsp; </body></p>

<p style="margin-left:80px"></html></p>

<p style="margin-left:80px">&nbsp;</p>

<p style="margin-left:40px">『注文完了画面』</p>

<p style="margin-left:80px"><img alt="" src="/uploadImage/20170809014405_4709410.jpg" /></p>

<p style="margin-left:80px"><html></p>

<p style="margin-left:80px">&nbsp; &nbsp; <body></p>

<p style="margin-left:80px">&nbsp; &nbsp; &nbsp; &nbsp; <?=<strong><span style="color:#e74c3c">$_POST['item']</span></strong> ?>の注文を承りました。</p>

<p style="margin-left:80px">&nbsp; &nbsp; </body></p>

<p style="margin-left:80px"></html></p>