-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
43 lines (42 loc) · 1.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
require_once 'core/load.php';
require_once \um\Load::helper('debug');
require_once \um\Load::package('antispam', 'SpamFilter');
require_once \um\Load::package('antispam', 'HoneyPotField');
require_once \um\Load::package('antispam', 'MultiOptionHoneyPotField');
if(!empty($_POST))
{
/* @var $sf \um\SpamFilter */$sf = \um\SpamFilter::retrieve();
if($sf->test())
{
echo 'Woohoo!';
}
else
{
die('inafire');
}
}
else
{
\um\MultiOptionHoneyPotField::setOptionsArray('I do not', 'Very', 'Mostly', 'Undecided', 'Other', 'Yes', 'No', 'Monday', '5', 'Clinical');
$sf = new \um\SpamFilter(array('honey_pots'=>12, 'verifiers'=>12, 'field_names'=>array('email', 'phone', 'question', 'commentary', 'profession', 'title', 'MI', 'firstname', 'lastname', 'murphy', 'middle', 'fullname', 'username', 'month', 'year', 'day')));
$sf->store();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="" method="post">
<?php
echo $sf->output();
?>
<input type="submit" name="hercules" value="Safe to click here" />
</form>
</body>
</html>
<?php
}
?>