Insert this code between <head> and </head> tags of your HTML document :
Insert a form between <body> and </body> tags :
Eventonsubmit calls checkMail() function and gives him text value of email field. Email field is identified by ID email.
Verify email format with PHP
This little PHP function allows you to check if the user wrote a valid email address that may exist. You call this function when you’re checking POST values after form submission.
if ((!ereg(“.+\@.+\..+”, $addr)) || (!ereg(“^[a-zA-Z0-9_@.-]+$”, $addr)))
// Use :
echo “Your email address is invalid!”;
It won’t prove real existence of the email address, but it will avoid the user from writing stupid stuff.
Ce message est également disponible en : French