Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( isset($_POST['envia']) && $_POST['envia'] == 'ok' ) {
- $post = $_POST;
- $result = file_get_contents( 'https://www.google.com/recaptcha/api/siteverify', false, stream_context_create( array(
- 'http' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'POST',
- 'content' => http_build_query( array(
- 'response' => $_POST['g-recaptcha-response'],
- 'secret' => 'secret_key'
- ) ),
- ),
- ) ) );
- $result = json_decode($result);
- var_dump( $result->success );
- // if everything's okay use your $post
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement