Headers - why not? You can fine tune your cache control. They are not necessary but they aren't harming anything either as long as that's how you want your caching set.
No, but you should. It causes no harm and makes your application more organized and easier to understand.
Technically no, because if
$_POST['lastname']
is empty nothing will be displayed anyway. But having it explicitly like you do is better, in case you want to append or prepend anything to it in the future. For example if you want to do<?php echo "Lastname: <h3>" . $_POST['lastname'] . "</h3>"; ?>
Then it will print with an empty value even if it's not present. If you want something to only print if it's available, set it with a condition like you have it now.
Indentation is fine.
Yes, you could have your HTML standalone and just send requests to the PHP file. It's just a matter of choice. Personally I make most everything into templates anyway and put them into the PHP with
require_once()
.That part doesn't matter, if I were you I'd likely separate them out anyway.