GlisWeb framework
_recaptcha.php
Vai alla documentazione di questo file.
1 <?php
2 
14  // inclusione del framework
15  require '../../../_src/_config.php';
16 
17  // test
18  if( isset( $_REQUEST['__test__'] ) ) {
19  $rs = recaptchaCheck( $_REQUEST['g-recaptcha-response'], $cf['google']['recaptcha']['profile']['keys']['private'] );
20  $tx = '<p>MODULO INVIATO</p>'
21 // . '<pre>' . print_r( $_REQUEST, true ) . '</pre>'
22 // . '<pre>' . print_r( $rs, true ) . '</pre>'
23  . '<p><a href="_recaptcha.php">ritorna</a></p>';
24  if( $rs['success'] == 1 ) {
25  $tx .= '<p>hai inviato con successo: ' . $_REQUEST['__test__']['testo'] . '</p>';
26  } else {
27  $tx .= '<p>a quanto pare non sei poi così umano</p>';
28  }
29  } else {
30  $tx = '<form action="" method="post">'
31  . '<input type="text" name="__test__[testo]" value="testo di test" />'
32  . '<div><input type="submit" /></div>'
33  . '<div class="g-recaptcha" style="display: inline-block;" data-sitekey="' . $cf['google']['recaptcha']['profile']['keys']['public'] . '"></div>'
34  . '</form>'
35 // . '<pre>' . print_r( $cf['google']['recaptcha'], true ) . '</pre>'
36  . '<script src="https://www.google.com/recaptcha/api.js"></script>';
37  }
38 
39  // output
40  buildHTML( $tx );
41 
42 ?>
$cf['ricerca']['template']
Definition: _030.common.php:7
buildHTML( $content, $encoding=ENCODING_UTF8, $headers=array())
recaptchaCheck( $token, $secret)
$token va preso da $_REQUEST[&#39;g-recaptcha-response&#39;]
$_REQUEST['__view__'][ $ct['view']['id']]['__restrict__']['id_progetto']['EQ']