|
Posted by Kenneth Farmer on 11/29/05 16:03
"Krustov" <krusty@krustov.co.uk.INVALID> wrote in message
news:MPG.1df5e2528013f9c198a7d6@no-cancel.newsreader.com...
> <comp.lang.php , Kenneth Farmer , kfarmer@NOSPAM.spyderbyte.com>
> <x6Nif.5222$q93.1597157@twister.southeast.rr.com>
> <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@sitename.org", "New Subscriber",
"[Newsletter] New Subscriber
$Email",
"From: $Email");
mail( "news-subscribe@sitename.org", "", "","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
[Back to original message]
|