From 86d73c96d44d893416a7f30d18511cf543acab9c Mon Sep 17 00:00:00 2001 From: ito493001 <114464389+ito493001@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:00:11 +0900 Subject: [PATCH 1/7] spell miss --- identify.php | 2 +- login.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/identify.php b/identify.php index a89f509..7e48065 100644 --- a/identify.php +++ b/identify.php @@ -19,7 +19,7 @@ $hashedPassword = hash('sha256', $password); // データを認証する -$sql = "SELECT * FROM `User` WHERE `username` LIKE '" .$hashedUsername. "' AND `passward` LIKE '" .$hashedPassword. "'";//クエリ +$sql = "SELECT * FROM `User` WHERE `username` LIKE '" .$hashedUsername. "' AND `password` LIKE '" .$hashedPassword. "'";//クエリ $result = $mysqli->query($sql); //echo $result -> num_rows; diff --git a/login.php b/login.php index fd9b6ac..9fefab4 100644 --- a/login.php +++ b/login.php @@ -18,7 +18,7 @@ // データを挿入する -$sql = "INSERT INTO `User` (`username`, `passward`) VALUES ('" .$hashedUsername. "', '" .$hashedPassword. "');";//クエリ +$sql = "INSERT INTO `User` (`username`, `password`) VALUES ('" .$hashedUsername. "', '" .$hashedPassword. "');";//クエリ $result = $mysqli->query($sql); From cdc0ef0704bfec9cbb66b7469f2eecebea399fb0 Mon Sep 17 00:00:00 2001 From: ito493001 <114464389+ito493001@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:18:49 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=A8=E7=99=BB=E9=8C=B2=E7=94=BB=E9=9D=A2=E3=82=92=E5=88=A5?= =?UTF-8?q?=E3=80=85=E3=81=AB=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- identify.php | 23 +++++++++++++++++- index.php | 22 +++++++++++++++++ login.html | 65 +++++++++++++++++++++++---------------------------- register.html | 39 +++++++++++++++++++++++++++++++ 4 files changed, 112 insertions(+), 37 deletions(-) create mode 100644 index.php create mode 100644 register.html diff --git a/identify.php b/identify.php index 7e48065..53e281f 100644 --- a/identify.php +++ b/identify.php @@ -1,4 +1,6 @@ close(); ?> + +
+ diff --git a/index.php b/index.php new file mode 100644 index 0000000..0264fb6 --- /dev/null +++ b/index.php @@ -0,0 +1,22 @@ +Welcome, " . $_SESSION['username'] . "!"; + + // セッションが有効期限切れになったかどうかをチェック + if (time() > $_SESSION['expire_time']) { + // セッションを終了して、login.htmlにリダイレクト + session_unset(); + session_destroy(); + header('Location: login.html'); + exit(); + } + } else { + // セッションが開始されていない場合、login.htmlにリダイレクト + header('Location: login.html'); + exit(); + } + ?> + + \ No newline at end of file diff --git a/login.html b/login.html index 92ecbea..c21045f 100644 --- a/login.html +++ b/login.html @@ -3,44 +3,37 @@ - + - - - - - + + -