From 244434eb0172af9a76b509d8d97adbc02686e723 Mon Sep 17 00:00:00 2001 From: Damian Johnson Date: Wed, 8 Jan 2020 17:31:14 -0800 Subject: [PATCH] Math captcha rather than text The default captcha is cutting down spam a bit, but some is getting through. The following has some advice... https://github.com/dapphp/securimage/issues/66 https://www.phpcaptcha.org/documentation/setting-options/ ... but regardless of that I find the math problems as a sender less annoying to solve. Lets give this a try for a bit. --- captcha.php | 16 ++++++++++++++++ contact.php | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 captcha.php diff --git a/captcha.php b/captcha.php new file mode 100644 index 0000000..86d2beb --- /dev/null +++ b/captcha.php @@ -0,0 +1,16 @@ +captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC; // simple math problem +$img->perturbation = .75; +$img->use_random_baseline = true; +$img->use_random_boxes = true; +$img->num_lines = mt_rand(2, 4); + +if (!empty($_GET['namespace'])) $img->setNamespace($_GET['namespace']); +$img->show(); // outputs the image and content headers to the browser +?> diff --git a/contact.php b/contact.php index 12ee07b..fb3f569 100644 --- a/contact.php +++ b/contact.php @@ -76,11 +76,11 @@

Please type the text below:

- CAPTCHA image + CAPTCHA image
-   different image +   different image

Message: