HTMLフォームに入力されたテキストを確認するスクリプトです。
入力フォームのHTMLは次のようになります。
<html>
<head>
<title>POSTテスト</title>
</head>
<body>
<form method="POST" action="post_test2.php">
テストテキスト:
<input type="text" name="test_text" />
<input type="submit" value="送信" />
</form>
</body>
</html>
<head>
<title>POSTテスト</title>
</head>
<body>
<form method="POST" action="post_test2.php">
テストテキスト:
<input type="text" name="test_text" />
<input type="submit" value="送信" />
</form>
</body>
</html>
入力されたテキストを確認するHTMLとPHPスクリプトは次のようになります。
<html>
<head>
<title>POSTテスト結果</title>
</head>
<body>
テストテキスト:<?php print($_POST['test_text']) ?>
</body>
</html>
<head>
<title>POSTテスト結果</title>
</head>
<body>
テストテキスト:<?php print($_POST['test_text']) ?>
</body>
</html>