Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Validate an email

Code Wizard, 12-30-2006

This script takes an email address and validates it to see whether the email containts the "@" character. If it does not the script prints "invalid" if it does then it will print "valid" however you can edit it at this part. It can be used as a function or as plain code. eg: www.whatever.com/email.php?email=someone@earthweb.com would result TRUE. www.whatever.com/email.php?email=someoneearthweb.com would result in invalid.

function validate_Email(){

$x = ereg("[@]",$email);

if($x==0){ PRINT" The email is invalid";EXIT;}

PRINT"Email is valid";

}
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions