Google
Edit File: captch.php
<?php session_start(); function getRandomPasswordUsingGUID($length) { // Generate a random string $guidResult = bin2hex(random_bytes($length)); // Ensure length is valid if ($length <= 0 || $length > strlen($guidResult)) { throw new Exception("Length must be between 1 and " . strlen($guidResult)); } // Return the first length bytes return substr($guidResult, 0, $length); } // Generate and set captcha on every page load $otp = strtoupper(getRandomPasswordUsingGUID(6)); $_SESSION['captcha'] = $otp; // Initialize message variable $captchaMessage = ""; ?>