even if I didnt bother to
put all those 'error messages' into a variable $message
like someone told above,
this is the solution to keep <doc type><html> and all this, if this feels right
while keeping all
written output between the <html> </html> tags
in beginning set $message = ''
then for each possible error add
$message .= 'password dont match<br>' and whatever
then in <body>
<?php echo $message; ?>
<form .......>
input here
</body></html>
In this way we have separated PHP code from HTML Output totally
which was my main point.
Because to do so, is good and proper programming style
and will not risk too many headers sent per page.
=========
a sidenote
<?=$mess;?> is bad programming and not recommended
you will discover this one day
when you upload your scripts to server not using php shorttags
<?
script
?>
anyone too lazy to write
<?php
shouldnt code PHP 😃
This is the recommended standard and will WORK AT ANY SERVER
<?php echo $message; ?>