Paste this to replace the first echo line in formandprocess.php:

?>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>                  
    </head>
    <body>
        <h1>A form</h1>
        <form method="post" action="formandprocess.php">
            <p><label for="firstname">Type your first name here: </label><input type="text" name="firstname" id="firstname"></p>
            <p><label for="surname">Type your surname here: </label><input type="text" name="surname" id="surname"></p>
            <p><label for="dob">Your date of birth (dd/mm/yyyy): </label><input type="text" name="dob" id="dob"></p>
            <p><input type="submit" name="submit"></p>
        </form>
    </body>
</html>
<?php

Try it and you should see the form.  Put something in at least the first two fields and press submit.  You should see the if doing it's job by showing the remaining echo message as the form has now been submitted.  On submission the page is reloaded.