From 7b29099bef1ef7dd744ba689419eea3e95e55d9a Mon Sep 17 00:00:00 2001 From: Wisdurm Date: Wed, 29 Oct 2025 09:53:48 +0200 Subject: [PATCH] Hash --- header.php | 2 ++ index.php | 2 +- kirjaudu_ulos.php | 8 ++++++++ kirjautunut.php | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 kirjaudu_ulos.php diff --git a/header.php b/header.php index cb0f7b5..8e629d2 100644 --- a/header.php +++ b/header.php @@ -9,6 +9,8 @@ include "kirjautunut.php"; ·"; + echo "Kirjaudu ulos"; } else { echo "Kirjaudu sisään"; diff --git a/index.php b/index.php index 1f7dda0..a6b2008 100755 --- a/index.php +++ b/index.php @@ -22,7 +22,7 @@ Nimi Harj. paikka Ohjaaja - Yhteystiedot + Yhmeystiedot Aloitus Lopetus Status diff --git a/kirjaudu_ulos.php b/kirjaudu_ulos.php new file mode 100644 index 0000000..6bf3400 --- /dev/null +++ b/kirjaudu_ulos.php @@ -0,0 +1,8 @@ + diff --git a/kirjautunut.php b/kirjautunut.php index 1e86f90..036083e 100644 --- a/kirjautunut.php +++ b/kirjautunut.php @@ -5,7 +5,7 @@ include "connect.php"; if(isset($_COOKIE["nimi"]) and isset($_COOKIE["salasana"])){ // TIEDOT $tunnus = mysqli_real_escape_string($conn, $_COOKIE['nimi']); - $salasana = mysqli_real_escape_string($conn, $_COOKIE['salasana']); + $salasana = hash("sha256", mysqli_real_escape_string($conn, $_COOKIE['salasana'])); // Hashaa salasana samalla // Etsi tiedot tietokentästä $sql = "SELECT * FROM `kayttajat` WHERE nimi='{$_COOKIE['nimi']}' LIMIT 1;"; $result = $conn->query($sql); // Aja komento -- 2.47.3