<?php
    function check_post() {
        if ($_SERVER["REQUEST_METHOD"] == "POST") {
            $_SESSION["num1"] = $_POST["num1"];
            $_SESSION["num2"] = $_POST["num2"];
            $num1 = $_SESSION["num1"];
            $num2 = $_SESSION["num2"];

            if ($num1 > 0 && $num2 > 0) {
                return true;
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }
    }

    function add($szam1, $szam2) {
        return $szam1 + $szam2;
    }

?>