…/O6-14-3/join/check.php
//周辺の画面と処理を作る(Create peripheral screens and processes) |
|
|
<?php |
|
|
session_start(); |
|
|
require('../dbconnect.php'); |
|
|
|
|
|
if (!isset($_SESSION['join']))
{ |
|
|
header('Location:
index.php'); |
|
|
exit(); |
|
|
} |
|
|
|
|
|
if (!empty($_POST)) { |
|
|
// 登録処理をする |
|
|
$statement = $db->prepare('INSERT INTO
members SET name=?,
password=?, picture=?, created=NOW()'); |
|
|
echo $ret = $statement->execute(array( |
|
|
$_SESSION['join']['name'], |
|
|
sha1($_SESSION['join']['password']), |
|
|
$_SESSION['join']['image'] |
|
|
)); |
|
|
unset($_SESSION['join']); |
|
|
|
|
|
header('Location:
thanks.php'); |
|
|
exit(); |
|
|
} |
|
|
?> |
|
|
<!DOCTYPE html> |
|
|
<html lang="ja"> |
|
|
<head> |
|
|
<meta
charset="UTF-8"> |
|
|
<meta
name="viewport" content="width=device-width,
initial-scale=1.0"> |
|
|
<meta
http-equiv="X-UA-Compatible" content="ie=edge"> |
|
|
<title>会員登録</title> |
|
|
|
|
|
<link
rel="stylesheet" href="../style.css" /> |
|
|
</head> |
|
|
<body> |
|
|
<div id="wrap"> |
|
|
<div id="head"> |
|
|
<h1>会員登録</h1> |
|
|
</div> |
|
|
|
|
|
<div id="content"> |
|
|
<p>記入した内容を確認して、「登録する」ボタンをクリックしてください</p> |
|
|
<form action="" method="post"> |
|
|
<input type="hidden" name="action" value="submit" /> |
|
|
<dl> |
|
|
<dt>ニックネーム</dt> |
|
|
<dd> |
|
|
<?php echo htmlspecialchars($_SESSION['join']['name'], ENT_QUOTES, 'UTF-8'); ?> |
|
|
</dd> |
|
|
<dt>パスワード</dt> |
|
|
<dd> |
|
|
【表示されません】 |
|
|
</dd> |
|
|
<dt>写真など</dt> |
|
|
<dd> |
|
|
<img
src="member_picture/<?php echo $_SESSION['join']['image']; ?>" width="100" height="100" alt="" /> |
|
|
</dd> |
|
|
</dl> |
|
|
<div><a href="index.php?action=rewrite">« 書き直す</a>
| <input type="submit" value="登録する"
/></div> |
|
|
</form> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</body> |
|
|
</html> |
|
|
|
|
|
|
|
|