-
Notifications
You must be signed in to change notification settings - Fork 0
/
proseschapta.php
29 lines (27 loc) · 968 Bytes
/
proseschapta.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$site_key = '6LcRLrQUAAAAADZSQwAy9_-oDj_cqIRECpHpEbaa'; // Diisi dengan site_key API Google reCapthca yang sobat miliki
$secret_key = '6LcRLrQUAAAAAPqLHEnvZGGqeEiu8HylW3nHbqpD'; // Diisi dengan secret_key API Google reCapthca yang sobat miliki
if (isset($_POST['submit']))
{
if(isset($_POST['g-recaptcha-response']))
{
$api_url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response='.$_POST['g-recaptcha-response'];
$response = @file_get_contents($api_url);
$data = json_decode($response, true);
if($data['success'])
{
$comment = $_POST['komentar'];
// proses penyimpananan dan lain-lain disini
$success = true;
}
else
{
$success = false;
}
}
else
{
$success = false;
}
}
?>