creating an registration form or feedback form, user has to enter, email address on the form which needs to validate manually. This is a good practice for making the application secure and your data from spams. For checking an email address to be valid or not, you have to check is against a regular expression.
An email id of the form id@example.com is a valid email address.
See the code below.
?php
if (isset($_POST['posted'])) {
$email = $_POST['email'];
$results = ereg(“^[^@ ]+@[^@ ]+.[^@ .]+$”, $email, $trashed);
if ($results) {
$isamatch = “Valid”;
} else {
$isamatch = “Invalid”;
}
echo “Email address validation says $email is ” . $isamatch;
}
?>
Excellent tips. Really useful stuff .Never had an idea about this, will look for more of such informative posts from your side... Good job...Keep it up Ecommerce Development Services in Bangalore | Ecommerce Website Design Agency Bangalore | Ecommerce Website Design and Development Company in India
ReplyDelete