Chào mừng!

Bằng cách đăng ký với chúng tôi, bạn sẽ có thể thảo luận, chia sẻ và nhắn tin riêng tư với các thành viên khác trong cộng đồng của chúng tôi.

Đăng ký ngay!
  • Chào Khách,
    Bạn cần liên hệ với admin ??? ZALO & TELEGRAM

Cần giúp Mình cần tìm 1 bạn tích hợp recaptcha chặn spam nạp thẻ

Tham gia
22/1/21
Bài viết
97
Lượt Thích
21
Coins
1,000
Mã:
<?php
//cấu hình thông tin do google cung cấp
$api_url     = 'https://www.google.com/recaptcha/api/siteverify';
$site_key    = 'site_key';
$secret_key  = 'secret_key';
  

//kiem tra submit form
if(isset($_POST['submit']))
{
    //lấy dữ liệu được post lên
    $site_key_post    = $_POST['g-recaptcha-response']; ///input gg tự tạo
    
    //lấy kết quả trả về từ google
    $response1 = file_get_contents($api_url.'?secret='.$secret_key.'&response='.$site_key_post);
    //dữ liệu trả về dạng json
    $response = json_decode($response1);
    if($response->success)
    {
        echo 'Captcha hop lệ';
        
    
    
    }else{
    echo 'Vui lòng Click xác minh ';
    }
}
?>
<?php echo $response1; ?>
<script src="https://www.google.com/recaptcha/api.js?hl=vi"></script>
<form action="" method="POST">
    <div class="g-recaptcha" data-sitekey="<?php echo $site_key?>"></div>
    <input type="submit" name="submit" value="submit">
</form>
 
Top Bottom
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock
No Thanks