[eluser]javer[/eluser]
Hi,
I need help with reCaptcha validation in codeigniter. Here is my code for validation :
Code:
$resp = $this->recaptcha->recaptcha_check_answer(
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]
);
if ($resp->is_valid)
{
echo 'ok';
}
else
{
echo 'fail';
}
It works fine when I enter some text into captcha field. If its correct it prints ok, if not it prints fail. So this is fine. The problem is when I leave captcha response field empty ( dont write there any text) then I get an error:
Trying to get property of non-object
that points to line
Code:
if ($resp->is_valid)
help please