|
Posted by Kenneth Farmer on 11/29/05 02:17
Several of my websites are getting hosed by automated scripts that insert
all kinds of jiberish into the forms and newsletter sign-up fields.
Sometimes I get a hundred an hour.
I noticed the other day http://www.emailbattles.com has a nice method to
confirm "Add Comments" forms are filled in by a person. They put a field in
the form that requires you to add two numbers and give the sum.
I'm not a php guru but I can tinker. Below is one of the newsletter sign-up
forms. Can someone show me how to add the ability to do what
EmailBattles.com does with their forms?
----------------------------------------
<HTML>
Enter your email address to subscribe</font><p>
<form method="post"
action="http://www.sitename.org/lists/lhpc-list-news.php"
Sitename.org Newsletter <a
href="http://www.sitename.org/pages.php?page=Newsletter-Registration">(details)</a><br>
<input type="text" name="Email" size="20">
<input type="submit" name="Submit" value="Go"></form>
</HTML>
----------------------------------------
<PHP>
<?
if (!isset($Email)) {
header( "Location: http://www.sitename.org/pages.php?page=Thanks" );
}
elseif (($Email == "")) {
header( "Location: http://www.sitename.org/pages.php?page=Error" );
}
else {
mail( "recipient@sitename.org", "New Subscriber",
"[News] New Subscriber
--------------------------------------------
$Email",
"From: $Email");
mail( "news-subscribe@sitename.org", "", "","From: $Email");
header( "Location: http://www.sitename.org/pages.php?page=Thanks" );
}
?>
</PHP>
Thanks for the help.
BTW, if the above is a sloppy method for a sign-up field for a newsletter
feel free to let me know.
--
Ken
_____________________________________
Kenneth Farmer <>< 336-736-7376
[Back to original message]
|