# contact-forms/1.9.2/classes/Validation/Captcha.php

Contact Forms by Cimatti, version 1.9.2. 15 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/1.9.2/code/classes/Validation/Captcha.php
- Raw: https://pluginprobe.com/plugins/contact-forms/1.9.2/raw/classes/Validation/Captcha.php
- Modified: 2023-03-14T12:04:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/1.9.2/code/classes/Validation/Captcha.php#L10-L20`.

```php
<?php
class AccuaForm_Validation_Captcha extends Validation {
	protected $message = "Error: The reCATPCHA response provided was incorrect.  Please re-try.";
	protected $privateKey;

	public function isValid($value) {
		require_once(dirname(__FILE__) . "/../../PFBC/Resources/recaptchalib.php");
		$resp = recaptcha_check_answer ($this->privateKey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
		if($resp->is_valid)
			return true;
		else
			return false;
	}
}

```
