Are those two sites hosted by different companies? I had a similar problem with the files provided by google. The solution was to use another method to get the response data, using curl. (I guess one hoster didn't support a prequisite for the given code.)
With a little help from
http://www.9lessons.info/2014/12/google-new-recaptcha-using-php-are-you.html I got it to work, looking like this (just insert keys at the beginning). It might work for you too, if you hoster(s) provide curl.
<html>
<head><title>reCAPTCHA Example</title>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=<?php echo $lang;?>">
</script>
</head>
<body>
<?php
// Verfiy Google Recaptcha v2 "NoCaptcha" with curl in php
// Insert keys
$siteKey = "";
$secret= "";
// Get Verfication from Google with curl
// Curl settings
function getCurlData($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16");
$curlData = curl_exec($curl);
curl_close($curl);
return $curlData;
}
// Get Google Response
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$recaptcha=$_POST['g-recaptcha-response'];
if(!empty($recaptcha))
{
$google_url="https://www.google.com/recaptcha/api/siteverify";
$ip=$_SERVER['REMOTE_ADDR'];
$url=$google_url."?secret=".$secret."&response=".$recaptcha."&remoteip=".$ip;
$res=getCurlData($url);
$res= json_decode($res, true);
}
}
// Check/Use the response
if($res['success'])
{
echo "You got it!";
}
?>
<form action="?" method="post">
<div class="g-recaptcha" data-sitekey="<?php echo $siteKey;?>"></div>
<br/>
<input type="submit" value="submit" />
</form>
</body>
</html>