Quote:
Originally Posted by vangogh
Just a reminder that you still need to check on the backend that an email address was submitted. There are a couple of ways to still have the form submitted even with the javascript check.
1. Disable javascript
2. Copy the source code, remove the onsubmit, and submit form
I'm guessing the validation is more for the user than you, but if you absolutely need the email you can't rely on front end validation. Don't forget the backend.
|
Yep! All you'd need to do is have a little if(isset($_POST['Email'])&&$_POST['Email']!=null) to make sure that the user really DID put something in the box instead of hacking their way through your Javascript. You can also run a email filter on the string to make sure it's an email, too. And if you REALLY want to go crazy, checkdnsrr will tell you whether or not the domain exists (gmail.com, yahoo.com, hotmail.com, etc).
|