mercredi 26 août 2015

"Use of undefined constant success - assumed 'success'" error parsing json response

im using google recaptcha and the way of my validation is through ajax, everything is working, I got a response

{
success: "false/true"
}

but i got an error saying "Use of undefined constant success - assumed 'success" on line 30, any ideas, help, suggestions, recommendations?

this is my code on the controller (the one i use in communicating the google recaptcha API)

$captcha=$request->input('g-recaptcha-response');
$response=file_get_contents("http://ift.tt/1EVsLjF".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']);
if($response.success == false) //this is the line 30
{
    return 'You are spammer ! Get the out';
}else{
    return 'Thanks for posting comment.';
}

this is the line 30 "$response.success == false"



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1U5M3z3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire