|
Posted by Matthew Wilson on 11/11/06 00:18
"Pedro Graca" <hexkid@dodgeit.com> wrote in message
news:slrnel9ihm.38r.hexkid@ID-203069.user.individual.net...
> ["Followup-To:" header set to comp.lang.php.]
> Matthew Wilson wrote:
>> Hi, we are getting a lot of spam through our PHP Feedback form, and have
>> set
>> up a new field 'prove you're human', asking them to do some simple maths.
>>
>> What is the command for the PHP script itself, to say "this field must be
>> equal to 9 or return the error page"?
>
> if ($_POST['human_proof'] != 9) {
> // spammer
> } else {
> // ok
> }
Thanks, that seems to work, although we amended it to:
if ($_POST['human'] != 9) {
header( "Location: $errorurl" );
exit ;
}
....then the rest of our script
What should "// spammer" be in your script? Should we have left that in, in
order to prevent all attacks? :-S
Matt
Navigation:
[Reply to this message]
|