<?php
if(isset($_POST['submit']) && !empty($_POST['submit'])):
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
//your site secret key
$secret = 'My Secret Key'; // I'm masking my secret key for privacy, but this is actually the key in the real code
echo nl2br("<b>secret:</b> " .$secret. "\n\n"); //Successfully echos the Secret Key
echo nl2br("<b>g-recaptcha-response: </b>\n" .$_POST['g-recaptcha-response']. "\n\n"); //Successfully echos the g-recaptcha-response
//get verify response data
echo nl2br("\n\nEND"); //This was added to confirm that the program is running past the file_get_contents command
//THE FOLLOWING ARE COMMENTED OUT FOR DEBUGGING PURPOSES
//echo nl2br("<b>verifyResponse (file_get_contents): </b>" .$verifyResponse. "\n\n");
//$responseData = json_decode($verifyResponse, true);
//echo nl2br("<b>responseData (json_decode): </b>" .$responseData['success']. "\n\n"); //echos NULL
//if($responseData->success):
// echo "<b>Success</b>";
// else:
// echo "<b>Failed</b>";
// endif;
endif;
endif;
?>
..