PHP code example of scpzc / hyperf-geetest

1. Go to this page and download the library: Download scpzc/hyperf-geetest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scpzc / hyperf-geetest example snippets


php bin/hyperf.php vendor:publish scpzc/hyperf-geetest

echo $this->geetest->captcha();

// 校验结果为 true 或 false
$this->geetest->validate($_POST['geetest_challenge'], $_POST['geetest_validate'], $_POST['geetest_seccode']);
 php
// $config 参数见下方[配置项]
/**
     * @Inject()
     * @var Geetest
     */
    private $geeTest;
 php
<?= $geetest->view();