| RU | EN | DE | IT | ES | FR | feedback |
I know that no one needs this :(, but if you ended up here and are reading this, then you probably need it...
Here you'll find my version of the world's most unbreakable captcha. Why my version? Because there are (SHOULD BE! I didn't specifically look) many websites that have a lot of stuff. Including similar captchas to protect against all sorts of spam crap.
IMPORTANT: If you think you just want to copy something and paste it somewhere so that everything works, then you're in the wrong place. Get out of here.
Technical requirements: If you need captcha for registration, adding guestbook entries, or adding comments, then you already have everything you need on your hosting. It's also highly recommended to have at least some understanding of programming and some knowledge of MySQL Workbench or phpMyAdmin.
What you need: PHP 7.x or PHP 5.x with some extensions (mysqli, mbstring). If I remember anything during testing, I'll add it.
Why is this the best captcha in the world? Because when you implement/connect the captcha, you create the task (ask a question) and enter the correct answer. If you have an anime-themed website, enter a question that only anime fans can answer correctly; if you have a cycling website, ask users questions about cycling.
Difficulties: I think the main challenge will be integration and making the captcha look good. Integration difficulty: If your site uses a user's captcha response somewhere, things aren't so simple. Regarding design: I'm not a designer, so the captcha will look like an unsightly gray stripe. If you're skilled, you can customize the placement and color of the elements. Just don't change the element names, or the captcha will break.
How to use: First, enter your data into the PHP script Kap4a.php: admin login and password, database name:
private $dbip = '127.0.0.1'; private $dbUser = 'db_admin123'; private $dbPsw = 'admuin_psw'; private $dbName = 'secretdb';
After this, you need to create a table with captcha variants. This is done in a MySQL tool, such as MySQL Workbench or phpMyAdmin. BEFORE ACCESSING THE DATABASE, MAKE A BACKUP OF THE DATABASE! MAKE SURE THAT A TABLE NAMED "cap" DOES NOT EXIST IN YOUR DATABASE.
CREATE TABLE `cap` ( `capid` int unsigned NOT NULL AUTO_INCREMENT, `vopr_cap` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, `otv_cap` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, PRIMARY KEY (`capid`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin ROW_FORMAT=COMPACT;
If you're experiencing errors due to utf8mb3_bin, try changing it to utf8mb2_bin or utf8mb_bin
Insert the captcha questions and answers into the table. IMPORTANT: Add answer options separated by a single space.
INSERT INTO `cap` VALUES (1,'0*(153-54/817+53636)','ноль нуль'), (2,'4*4/4','чотири четыре'), (3,'19 плюс 11','тридцять тридцать'), (4,'ваш_вопрос','ваш_ответ');
If the captcha is displayed and checked on the same page, add the following to the beginning of the page/script:
<?php require 'Kap4a.php'; $kap=new Kap4a(); $kap->check_kap4a($_POST['hiddcap'], $_POST['cap']); ?>
And in the place where the captcha is displayed, insert the following lines:
<?php $kap = new Kap4a(); $kap->show_kap4a(); ?>
Ahh, I almost forgot: the Kap4a.php file/script needs to be uploaded to the server in the root directory of the site.