【发布时间】:2018-08-09 08:59:21
【问题描述】:
我的托管服务器不允许file_get_contents。如何在不使用该调用的情况下获得 reCaptcha 的服务器验证?
$recaptcha_secret = "";
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$recaptcha_secret."&response=".$_POST['g-recaptcha-response']);
$responseKeys = json_decode($response,true);
if ($responseKeys["success"]==true) {
【问题讨论】:
-
是否加载了 curl 扩展?
-
Curl 扩展加载到远程服务器上