PhpTips.im - Everything about php - Download CMS, find tips and tricks, code snippetz, classes and more and more...
Bookmark this page !
   

Articles

    Home » Articles » General php tips » Valid Email Check
Published on : 02.05.2010 Category : General php tips Viewed : 34 times.

This will check an email, to see if it is in a valid format.
chkEmail.html

Code:

<form action="chkEmail.php" method="post">
    Email: <input type="text" name="email">
    <input type="submit" value="Check Email">
</form>
chkEmail.php

<?php
    $email = $_POST['email'];
    if(preg_match("~([a-zA-Z0-9!#$%&'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~",$email)){
        echo 'This is a valid email.';
    }else{
        echo 'This is an invalid email.';
    }
?>



Add this article in :

 

There is not yet any comment !



38 Rating: 0.0/10 (0 votes cast)

 

 Members
Log In !
Email Address :

Password :


Change my passowrd !
Sign Up !
We have : 3 members.
Latest member : albans
 
 Last Posts
 
 Advertising
 
©PhpTips.im 2010
Powered by PikaCMS.
Quick Links :
Home | Browse all articles | Downloads | Terms of Use
RSS RSS 2.0 : Articles | Downloads ATOM : Articles | Downloads