you don't have a submit button in your form, so no way to submit it. you will need to add a submit button
you can add an if statement around the echo so it only shows when the form is submitted:
<?php if($_SERVER['REQUEST_METHOD'] == "POST") { ?>
<p>z: <?php echo($_POST['element1'] + $_POST['element2']); ?>
<?php } ?>