The code is a little weird, because HTML tags are accepted... trying it on another way ;-)
<?php
// Form validation
if (strlen($Username) < 8){ $Error .= "<li>Username must be at least 8 characters long"; }
if (!checkdate($Date)){ $Error .= "<li>Date field has an incorrect value"; }
if (!empty($Error))
{
print ("<font color=#FF0000>Errors found\n<ul>$Error</ul>\n");
} else {
// INSERT into database
}
?>
<form>
</form>