Change:
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]) > 0) && isset($_POST)) {
to:
if (($_SERVER["REQUEST_METHOD"] == "POST")) {
and see if the validations start working... do you have a url where I can take a look at the page?