I’m getting the following error when implementing recaptcha. I’m not sure how to clear up the path error.
Fatal error: require_once(): Failed opening required ‘F:\xampp\htdocs\cyoa\application\controllers/recaptchalib.php’ (include_path=’.;\xampp\php\PEAR’) in F:\xampp\htdocs\cyoa\application\controllers\cyoa.php on line 132
controller:
public function register_insert()
{
require_once ('/recaptchalib.php');
$privatekey = "xxx";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
view:
<?php
require_once('recaptchalib.php');
$publickey = "xxx";
echo recaptcha_get_html($publickey);
?>
The controller line is the issue. If it’s in the same directory as the controller file, simply:
require_once ('recaptchalib.php');