This PHP class provides a simple interface to validate Google ReCAPTCHA responses using the Google ReCAPTCHA API. It requires a valid server-side API key to work.
- Include the 'ReCaptchaHandler.php' file in your PHP project.
- Get the ReCAPTCHA response token from the user (e.g., through a form submission).
- Use the 'ReCaptchaHandler::isResponseValid($response)' method to validate the token.
- The method returns 'true' if the token is valid, 'false' otherwise.
- The 'ReCaptchaHandler' class uses the Google ReCAPTCHA API to validate tokens, so ensure your server has internet access.
- To use the class, you need to obtain a valid server-side API key from the Google ReCAPTCHA website (https://www.google.com/recaptcha).
Author: @HichemTab-tech