<?php
function h($str){
return htmlspecialchars($str,ENT_QUOTES,'UTF-8');
}
session_start();
$name='';
$name = @$_SESSION['name'];
?>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>お問合せフォーム|初めてのPHP</title>
<link res="stylesheet" href="css/style.css">
</head>
<body>
<div id="container">
<header>
<h1>お問合せフォーム</h1>
</header>
<section>
<form action="check.php" method="post">
<table>
<tbody>
<tr>
<th><label for="name">お名前: </label></th>
<td><input type="text" name="name" id="name" value="<?php echo h($name); ?>"></td>
</tr>
<tr>
<th><label for="email">Eメール: </label></th>
<td><input type="text" name="email" id="email"></td>
</tr>
<tr>
<th><label for="message">お問合せ内容: </label></th>
<td><textarea name="message" id="message"></textarea></td>
</tr>
</tbody>
</table>
<input type="submit" value=" 確認 ">
</form>
</section>
<footer>
<p><small>(c) Silent Cait</small></p>
</footer>
</div>
</body>
</html>
PHP: エラー制御演算子 - Manual