Guys....
I have a problem when using google recaptcha v.2.0 . i really confused when installing google recaptcha in my php
$nama = isset($_POST['nama'])?trim(htmlentities($_POST['nama'])):'';
$komentar = isset($_POST['pj'])?trim(htmlentities($_POST['pj'])):'';
/* untuk menampung variabel post dari captcha google adalah g-recaptcha-reponse */
$captcha = isset($_POST['g-recaptcha-response'])?$_POST['g-recaptcha-response']:'';
//masukkan secret key-nya berdasarkan secret key masig-masing saat create api key nya
$secret_key = xxx';
$error = 'Gagal kirim form: periksa nama, komentar dan captcha nya';
if($captcha != '' && $nama != '' && $komentar != '') {
$recaptcha = file_get_contents($url);
$recaptcha = json_decode($recaptcha, true);
if(!$recaptcha['success']) {
//echo $error;
echo "<script type=\"text-javascript\">alert($error)</script>";
}else {
echo 'Nama Anda : '.$nama.'<br>Komentar Anda : '.$komentar;
}
}else {
echo "<script>alert('$error')</script>";
//echo $error;
}