Re: Email confirmation via sum
- From: "Kenneth Farmer" <kfarmer@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 14:03:45 GMT
"Krustov" <krusty@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:MPG.1df5e2528013f9c198a7d6@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> <comp.lang.php , Kenneth Farmer , kfarmer@xxxxxxxxxxxxxxxxxxxxx>
> <x6Nif.5222$q93.1597157@xxxxxxxxxxxxxxxxxxxxxxxx>
> <Tue, 29 Nov 2005 00:17:33 GMT>
>
>> 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?
>>
>
> Too late at night - but this should get you started .
>
>
> $z1=(rand()%9)+1;
> $z2=(rand()%9)+1;
>
> $z3=$z1+$z2;
>
> $z1 + $z2 = <input type="text" name="summ" size="25">
>
> <input type="hidden" name="demo" size="0" value="<?php print $z3; ?>">
>
>
> On the next page .....
>
> $aaa=$_POST['summ'];
> $bbb=$_POST['demo'];
>
> if ($aaa<>$bbb) {print "take a hike spammer <br>";}
Thanks for your help.
I'm afraid I don't know how to add it to the form and php script. :(
Here's the form and script again.
----------------------------------------
<HTML>
Enter your email address to subscribe</font><p>
<form method="post"
action="http://www.sitename.org/lists/lhpc-list-news.php"
<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@xxxxxxxxxxxx", "New Subscriber",
"[Newsletter] New Subscriber
$Email",
"From: $Email");
mail( "news-subscribe@xxxxxxxxxxxx", "", "","From: $Email");
header( "Location: http://www.sitename.org/pages.php?page=Thanks" );
}
?>
</PHP>
----------------------------------------
Thanks again to anyone who can help.
Ken
_____________________________________
Kenneth Farmer <>< 336-736-7376
.
- References:
- Email confirmation via sum
- From: Kenneth Farmer
- Email confirmation via sum
- Prev by Date: Re: Changes to php.ini not being read through
- Next by Date: Re: export flat file db into mysql?
- Previous by thread: Email confirmation via sum
- Next by thread: Re: Email confirmation via sum
- Index(es):
Relevant Pages
|