nycrite / captcha
An easy to use CAPTCHA generator for your verification needs.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
This package is auto-updated.
Last update: 2025-05-19 01:47:35 UTC
README
The better way to make image CAPTCHAs.
Why?
As a last resort, I created my own CAPTCHA generator after not wanting to use Google's reCAPTCHA. Certainly, Google's CAPTCHAs are more reliable, but I wanted to make my own alternative for certain cases.
Usage
First, initalize the CAPTCHA generator as so:
$captcha = new Nycrite\Captcha\Captcha(); $image = $captcha->image();
Optionally, if you are using the CAPTCHA creator for forms (you most likely are), you can save it to a session.
$_SESSION['phrase'] = $captcha->phrase;
Next, output the image by encoding it in base64.
echo "<img src='data:image/png;base64," . base64_encode($image) . "' alt='captcha'>";