cvs: phpweb / submit-event.php
| From: | Hannes Magnusson | Date: | Thu, 16 Apr 2009 14:13:03 +0000 |
| Subject: | cvs: phpweb / submit-event.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-4455@lists.php.net to get a copy of this message | ||
bjori Thu Apr 16 14:13:03 2009 UTC
Modified files:
/phpweb submit-event.php
Log:
Add an AI to detect spammers
http://cvs.php.net/viewvc.cgi/phpweb/submit-event.php?r1=1.38&r2=1.39&diff_format=u
Index: phpweb/submit-event.php
diff -u phpweb/submit-event.php:1.38 phpweb/submit-event.php:1.39
--- phpweb/submit-event.php:1.38 Thu Feb 14 08:33:38 2008
+++ phpweb/submit-event.php Thu Apr 16 14:13:03 2009
@@ -1,5 +1,5 @@
<?php
-// $Id: submit-event.php,v 1.38 2008/02/14 08:33:38 bjori Exp $
+// $Id: submit-event.php,v 1.39 2009/04/16 14:13:03 bjori Exp $
$_SERVER['BASE_PAGE'] = 'submit-event.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc';
@@ -104,6 +104,11 @@
$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 @@
<?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