} // aadressireale tekkis ?logout=1 if (isset($_GET["logout"])) { //kustutame sessiooni muutujad session_destroy(); header("Location: login.php"); } //**************** //****HALDUS****** //**************** $InterestManager = new InterestManager($mysqli, $_SESSION['user_id']); if (isset($_GET["new_interest"])) { $add_interest_response = $InterestManager->addInterest($_GET["new_interest"]); } if (isset($_GET["dropdown_interest"])) { $add_user_interest_response = $InterestManager->addUserInterest($_GET["dropdown_interest"]); } ?> <p> Tere, <?php echo $_SESSION['user_email']; ?> <a href="?logout=1">Logi välja</a> </p> <br> <h2>Lisa huviala</h2> <?php if (isset($add_interest_response->error)) {
header("Location: login.php"); exit; } //login välja, aadressireal on ?logout=1 if (isset($_GET["logout"])) { //kustutab kõik sessiooni muutujad session_destroy(); header("Location: login.php"); exit; } $InterestManager = new InterestManager($mysqli); if (isset($_GET["new_interest"])) { $interests_response = $InterestManager->addInterest($_GET["new_interest"]); } if (isset($_GET["dropdownselect"])) { $added_user_interests = $InterestManager->addUserInterest($_GET["dropdownselect"], $_SESSION["id_from_db"]); } ?> <p> Tere, <?php echo $_SESSION["user_email"]; ?> <a href="?logout=1"> Logi välja</a> </p> <h2>Lisa uus huviala</h2> <?php if (isset($interests_response->error)) { ?> <p style="color:red;"><?php