<?php
$message = null;

if(isset($_POST['email'])) {
    if(!preg_match('/^[0-9a-zA-Z_.-]+@.+$/', $_POST['email'])) {
        $message = 'Wpisz prawidłowy email';
    }
}
?>
<html>
<head>

</head>
<body>

<?php if($message): ?>
<p><?= $message ?></p>
<?php endif; ?>

<form action="" method="post">
<input name="email" />
<input type="submit" value="OK" />

</form>

</body>
</html>
