フォームの練習 其の3

フォームの練習7

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>フォームの練習</title>
</head>

<body>
<form action="ex01.php" method="GET">
1つめ:<input type="text" name="first"><br />
2つめ:<input type="text" name="second"><br />
<input type="submit" value="送信する">
</form>
</body>
</html>

フォームの練習8

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>フォームの練習</title>
<link rel="stylesheet" type="text/css" href="part3_sample/style.css">
</head>

<body>
<div id="wrap">
<div id="head">
<h1>フォームに入力した内容を取得する</h1>
</div><!--head-->

<div id="content">
<p style="margin-top: 200px">
<form action="part3_sample/sample04.php" method="get">
<label for="my_name">お名前:</label>
<input id="my_name" type="text" name="my_name" size="35" maxlength="255" value="">
<input type="submit" value="送信する">
</form>
</p>
</div><!--content-->
</div><!--wrapper-->
</body>
</html>

php

<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>フォームの練習</title>
<link rel="stylesheet" type="text/css" href="part3_sample/style.css">
</head>

<body>
<div id="wrap">
<div id="head">
<h1>フォームに入力した内容を確認する。</h1>
</div><!--head-->
<div id="content">
<p style="margin-top : 200px">
<?php 
print('お名前:'.htmlspecialchars($_REQUEST['my_name'],ENT_QUOTES));
?>
</p>
</div><!--content-->
</div><!--wrap-->
</body>
</html>