forked from appleboy/CodeIgniter-reCAPTCHA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
26 lines (23 loc) · 823 Bytes
/
test.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
<?php defined('BASEPATH') or exit('No direct script access allowed');
class test extends CI_Controller
{
public function recaptcha()
{
// load from spark tool
$this->load->spark('recaptcha-library/1.0.1');
// load from CI library
// $this->load->library('recaptcha');
$recaptcha = $this->input->post('g-recaptcha-response');
if (!empty($recaptcha)) {
$response = $this->recaptcha->verifyResponse($recaptcha);
if (isset($response['success']) and $response['success'] === true) {
echo "You got it!";
}
}
$data = array(
'widget' => $this->recaptcha->getWidget(),
'script' => $this->recaptcha->getScriptTag(),
);
$this->load->view('recaptcha', $data);
}
}