From 350f937b4f6bbcfdd945260f512054ec5c833a0d Mon Sep 17 00:00:00 2001 From: szabomarton Date: Wed, 4 Dec 2024 09:23:17 +0100 Subject: [PATCH] added some stuff --- SQL_Feladat_AdatB/index.php | 74 +++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/SQL_Feladat_AdatB/index.php b/SQL_Feladat_AdatB/index.php index f87c9a3..051dfb3 100644 --- a/SQL_Feladat_AdatB/index.php +++ b/SQL_Feladat_AdatB/index.php @@ -1,41 +1,51 @@ prepare($parsql); - $durr->bind_param("ssssss", - $_POST["vnev"], - $_POST["knev"], - $_POST["email"], - $_POST["telefon"], - $_POST["lakcim"], - $aktiv - ); - - if ($durr->execute()==true){ - echo 'sikeres feltöltés'; + if (!isset($_SESSION["datainserted"])){ + if( + isset($_POST["vnev"]) && + isset($_POST["knev"]) && + isset($_POST["email"]) && + isset($_POST["telefon"]) && + isset($_POST["lakcim"]) && + isset($_POST["tagsag_kezdete"]) && + isset($_POST["aktiv_tagsagi_statusz"]) + ){ + //TODO ADD tagsag kezdete + if ($_POST["aktiv_tagsagi_statusz"]==true){ + $aktiv = 1; + } else { + $aktiv = 0; + } + + $parsql = "INSERT INTO tagok (vnev, knev, email, telefon, lakcim, aktiv_tagsagi_statusz, tagsag_kezdete) + VALUES (?,?,?,?,?,?,?)"; + + $durr = $conn->prepare($parsql); + $durr->bind_param("sssssss", + $_POST["vnev"], + $_POST["knev"], + $_POST["email"], + $_POST["telefon"], + $_POST["lakcim"], + $aktiv, + $_POST["aktiv_tagsagi_statusz"] + ); + + if ($durr->execute()==true){ + echo 'sikeres feltöltés'; + $_SESSION["datainserted"] == true; + } } } - - + if(isset($_SESSION["datainserted"])){ + if($_SESSION["datainserted"]){ + unset($_SESSION["datainserted"]); + } + } ?>