Instructions

Add-on Details

The captcha add-on can help prevent bots and unwanted guests from registering. The reCAPTCHA v3 is the preferred choice as it's much more secure.

Note: The PHP GD extension is required for this add-on to work. Edit the "php.ini" file and uncomment/add "extension=gd" or "extension=gd2" or enable it in your control panel. Once enabled, you will need to restart PHP.

How To Add

Add the "captcha.php" file to your "phplogin" directory.

Edit the "register.php" file and find this line:

<div class="msg"></div>

Add above:

<div class="captcha">
	<img src="captcha.php" width="150" height="50">
	<input class="form-input" type="text" id="captcha" name="captcha" placeholder="Enter captcha code" title="Please enter the captcha code!" required>
</div>

Edit the "register-process.php" file and find this line:

if (!isset($_POST['username'], $_POST['password'], $_POST['cpassword'], $_POST['email'])) {

Replace with:

if (!isset($_POST['username'], $_POST['password'], $_POST['cpassword'], $_POST['email'], $_POST['captcha'], $_SESSION['captcha'])) {

Find this line:

if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {

Add above:

if ($_SESSION['captcha'] !== $_POST['captcha']) {
	exit('Error: Incorrect captcha code!');
}