Publisher Bucks |
08-04-2022 07:19 AM |
Best method to validate email address on form submit?
So we have just started including a small email collection link on some of our newer eBooks, people seem to be subscribing although we're also getting a lot of empty form submissions.
(The form just submits the data - Name, Email, IP, Date/time to an SQL database right now until we start working on a mailing script).
What is the best way to verify that the email being submitted (or blank form) is a valid email? Php?HTML5? Javascript? Something else?
This is the form code we're using (in case that matters?):
Quote:
<form action="https://www.domain.com/submission.php" method="post">
<input type="text" name="name" id="name" style="width: 180px" value="Full Name" />
<input type="text" name="email" id="email" style="width: 180px" value="Email Address" />
<input type="hidden" name="date" id="date" style="width: 180px" value="<?php echo date("F j, Y, g:i a"); ?>" />
<input type="hidden" name="ip" id="ip" style="width: 180px" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />
<input type="submit" value="Get Updates" />
</form>
|
Any help / advice you can offer would be appreciated :thumbsup
|