Instructions

Add-on Details

The captcha add-on can help prevent bots and unwanted guests from registering.

Note: The PHP GD extension is required for this add-on to work.

How To Add

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

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

<input type="email" name="email" placeholder="Email" id="email" required>

Add below:

<div class="captcha">
	<img src="captcha.php" width="150" height="50">
	<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('Incorrect captcha code!');
}