<?php
    if (!isset($_COOKIE["belepve"])){
        if (isset($_POST["name"]) && isset($_POST["password"]) && $_POST["password"] == "alma"){
            setcookie("belepve", 1);
            setcookie("name",  $_POST["name"]);        
        } else{
            echo "Nincs kitöltve min den mező";
        }
    
           
    }
    
    if (isset($_COOKIE["belepve"])){
        echo $_COOKIE["name"];
        echo '<form action="index.php" method="POST"><input type="hidden" name="kilep" value="1"><button type="submit">KILÉP</button></form>';
    }

    
?>

