flatpressblog / flatpress

FlatPress is a lightweight, easy-to-set-up flat-file blogging engine.
https://flatpress.org
GNU General Public License v2.0
185 stars 57 forks source link

Plugin: Accessible Antispam #138

Closed Fraenkiman closed 9 months ago

Fraenkiman commented 2 years ago

Hello, everyone. add the solution of a mathematical problem (Accessible Antispam) to the contact form. (e.g. like leaving a comment). There is currently no way to protect yourself from spam mails, as was possible with FlatPress 1.2.1.

With best regards Frank.

axelhahn commented 2 years ago

Hi Frank, It is part of the distribution already. Maybe it was deactivated in the plugin section (admin.php?p=plugin - "Accessible Antispam")?! Axel

Fraenkiman commented 2 years ago

Hello, Axel.

Accessible Antispam is active in version 3.0. If you want to add a comment under a post, the mathematical task is also displayed. Not with contact.php. I imagine that this has not been possible since the contact form was revised. I use fp-1.3dev master. The template may be missing {comment_form} on line ~51 and the PHP code may need to be adjusted.

Best regards

azett commented 1 year ago

Might be related to c2f64b1d1a44851e65eb80bc684d5a9c35f9dd3b

paragbagul111 commented 1 year ago

for prevent anti spam in contact feature you can capacha

Download Securimage:

Visit the Securimage website (https://www.phpcaptcha.org/) and download the latest version of the library. Extract the downloaded archive. Prepare your directory structure:

Create a directory in your project where you want to store the Securimage files, e.g., "captcha". Copy the following files from the extracted Securimage archive into the "captcha" directory: securimage.php securimage_show.php securimage_play.php (optional, for an audio CAPTCHA) Update your PHP code:

In the PHP script that handles the form submission, you need to include the Securimage library and validate the CAPTCHA response. Here's an example:

<?php require_once('captcha/securimage.php');

// Process form submission if ($_SERVER["REQUEST_METHOD"] === "POST") { // Verify CAPTCHA $securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
    // CAPTCHA verification failed, handle the error accordingly
    // ...
} else {
    // CAPTCHA verification successful, continue with form processing
    // ...
}

} ?> Display the CAPTCHA in your contact form:

Add the following HTML code snippet inside your contact form where you want the CAPTCHA to appear:

CAPTCHA Image

Refresh CAPTCHA

Style the CAPTCHA if needed:

You can apply CSS styles to the CAPTCHA image and input field to match the design of your contact form.

paragbagul111 commented 1 year ago

`CAPTCHA Image

Refresh CAPTCHA `