<html>
<head><title></title></head>
<body>
<?php
if (isset($_POST['posted'])) {
$email = $_POST['email'];
$theresults = ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email);
if ($theresults) {
$message= "Valid";
} else {
$message= "Invalid";
}
echo "Email address validation says $email is " . $message;
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="posted" value="true">
Enter your email address for validation:
<input type="text" name="email" value="myemail@domain.com">
<input type="submit" value="submit">
</form>
</body>
</html> |