1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Add an AI to detect spammers

This commit is contained in:
Hannes Magnusson
2009-04-16 14:13:03 +00:00
parent 9d6bf7d6e5
commit b1747f08aa

View File

@@ -104,6 +104,11 @@ if ($process) {
$errors[] = "You must specify a valid day of the month for a recurring event.";
}
// Spam question
if ($_POST["sane"] != 3) {
$errors[] = "It's OK. I'm not real either";
}
if (preg_match("/submit/i", $_POST["action"])) {
// Submit to master.php.net
$result = posttohost("http://master.php.net/entry/event.php", $_POST);
@@ -240,6 +245,10 @@ if ($process && count($errors) === 0) {
<?php }?>
</th>
</tr>
<tr>
<th class="subr">Are you real?</th>
<td><select name="sane"><?php display_options(array("I'm an robot", "I used to be", "WTF?", "Yes", "No, but I'd still want to submit this"), "WTF?"); ?></select></td>
</tr>
</table>
</form>
<?php