/* Google Analytics ▽ */ /* Google Analytics △ */

WEB制作の勉強メモ / 猫脳人間

HTML CSS JavaScript ActionScript jQuery WordPress PHP Illustrator Photoshop Flash … 猫サイズの脳でも覚えるぞ と…

PHPの授業メモ

index.php

<?php

function h($str){
  return htmlspecialchars($str,ENT_QUOTES,'UTF-8');
} // h() →自作関数、ユーザー定義関数 と言う

session_start();
$name='';
$name = @$_SESSION['name'];


?>

<!DOCTYPE html>
<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><!-- /#container -->

</body>
</html>

PHP: エラー制御演算子 - Manual