質問編集履歴
1
②で乗せるコードを間違えていたので、更新しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,6 +40,7 @@
|
|
40
40
|
}
|
41
41
|
?>
|
42
42
|
<?php require '../footer.php'; ?>
|
43
|
+
|
43
44
|
②
|
44
45
|
<?php session_start(); ?>
|
45
46
|
<?php require '../header.php'; ?>
|
@@ -48,8 +49,8 @@
|
|
48
49
|
unset($_SESSION['customer']);
|
49
50
|
$pdo=new PDO('mysql:host=localhost;dbname=shop;charset=utf8',
|
50
51
|
'staff', 'password');
|
51
|
-
$
|
52
|
+
$row=$pdo->prepare('select * from customer where login=? and password=?');
|
52
|
-
$row
|
53
|
+
$row->execute([$_REQUEST['login'], $_REQUEST['password']]);
|
53
54
|
|
54
55
|
$_SESSION['customer']=[
|
55
56
|
'id'=>$row['id'], 'name'=>$row['name'],
|