Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-04-2022, 07:19 AM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,149
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
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2022, 07:48 AM   #2
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,098
php filter_var() function.

https://www.php.net/manual/en/function.filter-var.php

https://www.php.net/manual/en/filter...s.validate.php

https://www.w3schools.com/php/php_form_url_email.asp

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2022, 07:51 AM   #3
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
You could start with input type='email', and remove the date and ip ones entirely and pull this data from php directly on the submission.php page.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2022, 09:53 AM   #4
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,149
Awesome, thank you all for the suggestions
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-06-2022, 01:05 AM   #5
Coyote
Drinker of Scotch
 
Industry Role:
Join Date: May 2003
Location: Texas
Posts: 242
Quote:
Originally Posted by Publisher Bucks View Post
What is the best way to verify that the email being submitted (or blank form) is a valid email? Php?HTML5? Javascript? Something else?
Validating an email address syntax in php can be done as described by sarettah. As k0nr4d mentioned, the HTML input will also validate the syntax. However, neither method can determine if the email address actually exists. Even using checkdnsrr will only verify if there is a mail server -- Not that the user exists.

The simplest method to validate the actual email address is to send a verification email to that user whereby they either click the embedded link or paste the verification code into a field, then you check that response against the previous database entry. Include an expiration time where you delete the database entry.

Having an expiration will allow a user to re-submit their data should they initially enter an email with a typo (the user will not receive the validation email). Should that user subsequently submit correct data it will match the database entry and they can continue with your procedure.

Hope this helps.
__________________
Ethernet Servers

Quote:
CS: Linux can pretty much run on a potato. Which is a GOOD thing.
Coyote is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-06-2022, 04:28 AM   #6
baodb
Confirmed User
 
Industry Role:
Join Date: Jan 2021
Posts: 103
Others have already mentioned the frontend changes you should make, additionally before storing the response you can also send the email through a free service like https://www.mailcheck.ai/ via your backend script.
baodb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
form, email, database, sql, verify, script, start, mailing, blank, code, matters, submitted, valid, javascript, php?html5, data, link, collection, ebooks, including, method, address, submit, started, people



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.