PHPackages                             wymarzonylogin/piksel-kapcio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. wymarzonylogin/piksel-kapcio

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

wymarzonylogin/piksel-kapcio
============================

Captcha, but not really

1.1.0(3y ago)120MITPHP

Since Nov 6Pushed 3y agoCompare

[ Source](https://github.com/wymarzonylogin/piksel-kapcio)[ Packagist](https://packagist.org/packages/wymarzonylogin/piksel-kapcio)[ Docs](https://wymarzonylog.in)[ RSS](/packages/wymarzonylogin-piksel-kapcio/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Piksel Kapcio
=============

[](#piksel-kapcio)

This is a **PHP** captcha-like library.

[![piksel-kapcio-title](https://camo.githubusercontent.com/5be2c3946deb41cb3b2033b4dcaab240dba216c11231258905660624aff36e49/68747470733a2f2f77796d61727a6f6e796c6f672e696e2f696d672f6769746875622f70696b73656c2d6b617063696f2f70696b73656c2d6b617063696f2d7469746c652e706e67)](https://camo.githubusercontent.com/5be2c3946deb41cb3b2033b4dcaab240dba216c11231258905660624aff36e49/68747470733a2f2f77796d61727a6f6e796c6f672e696e2f696d672f6769746875622f70696b73656c2d6b617063696f2f70696b73656c2d6b617063696f2d7469746c652e706e67)

Advertisment
------------

[](#advertisment)

Are you tired of users complaining that this obscure captcha you use on your website is sooo annonying and hard to solve? Are you bored with all the bots being defeated by the captcha you use? Well, we have good news for you! **Piksel Kapcio** is now available! It's a captcha library, but not really! It's really easy to read, both for humans and bots!

By the way, ever wondered how captcha would look like on C64?

What is it?
-----------

[](#what-is-it)

It's bascially a simple captcha package to use within your PHP projects.

Disclaimer
----------

[](#disclaimer)

Use at your own risk! This was never meant to be a hard to solve captcha. I never tried it against bots, so I can only assume it's not really good. This was created more as an easy to configure, easy to use, easy to solve thing, with specific esthetics applied, that would throttle human users a bit. This works great in my use case, but it doesn't have to for you! Always pick right tool for the job.

Installation
------------

[](#installation)

Easy peasy, just use composer:

```
composer require wymarzonylogin/piksel-kapcio
```

Basic usage
-----------

[](#basic-usage)

Typical flow for captchas is as follows:

- In a captcha-protected form presented to user, include text field for his captcha answer (usually labelled as "Type in code from picture" or something like that). In our examples we will give this field name "captcha\_code".
- Show captcha image somwhere in or near to the form mentioned above
- When the user submits the form, there need's to be a check, if code he provided is the one which is solution for image presented to him. If yes, process the form as valid, otherwise, reject submission and show user an error message like "Invalid code".

In other words, you need to take 3 steps to use it:

1. Create endpoint serving images to user (and also storing generated code text in session)
2. Modify your form to show image (call endpoint from step 1) and add field for user's solution for captcha (also show there error, if solution is wrong).
3. Verify submitted user's captcha solution.

### 1. Endpoint serving images

[](#1-endpoint-serving-images)

Here is the example of basic endpoint:

```
