Bots spam my form mail. How can I require an e-mail address for a submission?
Hello all:
Bots have very recently begun relentlessly spamming my simple htmp form mail page. I'm getting over a hundred spammed submissions per day now, albeit with no e-mail addresses offered by such pesky spambots.
Use of CAPTCHA-like services for filtering purposes concerns me though, since I've seen them screen out my own legitimate submissions elsewhere in the past.
Is there any html coding I can use, though, to require the submission of an "@" containing e-mail address in a particular one of the form's individual boxes? I require an e-mail address for a submission and humans very seldom have a problem complying.
Any suggestions, please?
As a sidenote, if there's a way to make it so that the form won't erase all inserted contents if one mistakenly forgets to insert an "@" symbol, then that would help as well.
It is very easy in PHP or JavaScript to block submission of the form if an email address is not given, or is not correctly formatted. I do not understand your problem. E.g. This PHP fragment:
Thanks for the interesting reply. I wonder if such a PHP fragment could successfully work if inserted somewhere in what's seemingly just an html e-mail submission form. Regarding the html that I can see, the following is included:
<INPUT TYPE="submit" VALUE="Send">
Perhaps the rest is stored on the server with the hosting company. I wonder if that affects your analysis? Either way, I greatly appreciate your feedback.
The <input> tag is not the problem. The important info is in the <form> tag at the beginning of the form. Unless it uses JavaScript, this should say something like:
<form action="xxx" method=post>
The "xxx" is the url of the script used to process the form input. That is where the PHP fragment (or similar) goes. By the way, one way to stop the form being cleared when it is submitted is to embed the PHP script in the page containing the form. See http://www.emberwebsites.co.uk/Contact.php. This uses just html/php processing of the email, with no JavaScript or libraries. It may be a little difficult to follow at first, but everything you should need is there.
Bookmarks