3月10日作業データ(お問合せフォーム)

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>phpでの変数と文字列の扱い方</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>入力画面</h1>
<form action="confirm.php" method="post">
<dl class="list">
<dt>お名前<span>必須</span></dt>
<dd><input type="text" name="onamae" required placeholder="お名前を入力して下さい" autocomplete="name"></dd>
<dt>メールアドレス<span>必須</span></dt>
<dd>
<input type="email" name="email" required placeholder="メールアドレスを入力して下さい" autocomplete="email">
</dd>
<dt>お問い合わせ内容<span>必須</span></dt>
<dd>
<textarea name="message" required placeholder="お問い合わせ内容をご入力して下さい"></textarea>
</dd>
</dl>
<div class="btn-wrapper">
<input type="submit" value="確認画面へ">
<input type="reset" value="リセット">
</div>
</form>
</body>
</html>


confirm.php

<?php
$name = $_POST["onamae"];
$email = $_POST["email"];
$message = $_POST["message"];
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>phpでの変数と文字列の扱い方</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>確認画面</h1>
<form action="" method="post">
<dl class="list">
<dt>お名前</dt>
<dd>
<?php echo $name; ?>
</dd>
<dt>メールアドレス</dt>
<dd><?php echo $email; ?></dd>
<dt>お問い合わせ内容</dt>
<dd><?php echo $message; ?></dd>
</dl>
<div class="btn-wrapper">
<input type="submit" value="送信">
<input type="button" value="入力画面に戻る">
</div>
</form>
</body>
</html>


style.css

@charset "utf-8";

h1{
text-align: center;
margin: 30px 0;
}
form{
max-width: 700px;
padding: 0 10px;
margin: 0 auto 50px;
}
.list{
display: flex;
flex-wrap: wrap;
}
.list>dt{
width: 30%;
margin-bottom: 40px;
}
.list>dd{
width: 70%;
margin-bottom: 40px;
}
.list span{
font-size: 13px;
background-color: #1d487e;
color: #FFF;
padding: 2px 4px;
margin-left: 10px;
}


[type="text"],[type="email"]{
width: 60%;
padding: 10px;
background-color: aliceblue;
border: 1px solid #666;
border-radius: 4px;
}
[type="text"]:focus,[type="email"]:focus{
background-color: #ffffff;
}
textarea{
width: 80%;
height: 180px;
padding: 10px;
background-color: aliceblue;
border: 1px solid #666;
border-radius: 4px;
}
textarea:focus{
background-color: #ffffff;
}
.btn-wrapper{
display: flex;
justify-content: center;
}
[type="submit"]{
padding: 14px 50px;
background-color: #e78397;
margin-right: 50px;
}
[type="reset"]{
padding: 14px 20px;
background-color: #d1cecf;
}
[type="submit"]:hover,[type="reset"]:hover{
filter: brightness(110%);
}