I M WORKING WITH A REGISTER/LOG IN SCRIPT BUT WHEN I TYPE ANY EMAIL IT LETS IT REGISTER DOES ANY ONE HAVE A EMAIL VALIDATION SCRIPT I CAN ADD TO MY SCRIPT TO CHECK IF EMAIL IS VALID
PLS HELP
Four answers:
weirdbeardmt
2008-05-01 12:14:07 UTC
Bosh.
?
2008-05-01 19:22:09 UTC
There's validation that an email address is an email address using regular expressions, confirmation that an email address actually belongs to who entered it by using a double opt in system, and a way to check if an email address actually exists. I can't help you with this in PHP, but if you advise exactly what you want, no doubt someone will.
nookkin
2008-05-01 22:42:58 UTC
You can use regular expressions to check the syntax of the email. Don't use JavaScript, since you never know if the client has javascript enabled or not. Here is how to do it in PHP (assuming that the email address is stored in the variable $f_email):
This will check to see whether or not the email address uses the syntax "person@website.tld" and checks for invalid characters. (NOTE: remove the spaces after each + character).
If you want to check whether or not the email entered actually belongs to a person (and is not fake), you will need to send a confirmation message to the address.
Eyes Drinker
2008-05-01 19:19:55 UTC
Its better to use Javascript email validation script instead of PHP..... bcoz javascript will not submit form unless value email entered ... with PHP validation script once the form will be submitted then it will check and use have to go back and re-enter .... here is javascript validation code.
PUT the following between your
then after pasting above code in your head .... adding the following in your form tag
onSubmit="return checkForm();"
e.g. in the following line
onSubmit="return checkForm();"
action="register_user.php" method="post">
hopes this detailed reply will help you..
after this when you will submit form if the email will not be valid it will popup alert box and will not submit form untill user will not enter correct email
Cheerz...
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.