You are here: Email confirmation via sum « PHP Programming Language « IT news, forums, messages
Email confirmation via sum

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация