Php 为什么谷歌在我的过程中没有回电?
已编辑:我已在管理面板中注册我的域 blabla.org 但它仍然不起作用 因此,我有一些谷歌recaptcha验证过程 但是当我点击按钮的时候,这个过程 $response无法检测到,并且它提供了空内容 这是我的密码Php 为什么谷歌在我的过程中没有回电?,php,recaptcha,Php,Recaptcha,已编辑:我已在管理面板中注册我的域 blabla.org 但它仍然不起作用 因此,我有一些谷歌recaptcha验证过程 但是当我点击按钮的时候,这个过程 $response无法检测到,并且它提供了空内容 这是我的密码 $site_key = 'secret'; $secret_key = secret'; if(isset($_POST['req_token'])){ if(isset($_POST['g-recaptcha-response'])) {
$site_key = 'secret';
$secret_key = secret';
if(isset($_POST['req_token'])){
if(isset($_POST['g-recaptcha-response']))
{
$api_url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response='.$_POST['g-recaptcha-response'];
$response = file_get_contents($api_url);
$data = json_decode($response);
if($data['success'])
{
$nama =$_POST['nama'];
$email =$_POST['email'];
$telp_1 =$_POST['telp_1'];
$status_id = 1;
$sql="INSERT INTO data_recruitment
( status_id,
nama,
email,
telp_1
)
VALUES
( '$status_id',
'$nama',
'$email',
'$telp_1'
)";
if(mysqli_query($conn, $sql)){ // jika query insert berhasil dieksekusi
header("location:../index.php?status=1");
}
else{
header("location:../index.php?status=2");
}
} else
{
header("location:../index.php?status=4");
}
}
else{
header("location:../index.php?status=3");
}
}
在我的服务器中未检测到$response。但是当我在localhost中测试时。这个过程运作良好
有什么建议吗?你看了这个吗
您可能需要执行phpinfo()操作,并查看服务器正在运行的版本。您是否查看了此操作
您可能需要执行phpinfo()并查看服务器运行的版本。我在服务器上使用的是PHP7。它应该可以工作:(我检查我的php.ini.it all ready set on.allow_url_fopen=Oni在我的服务器上使用PHP7.it应该可以工作:(我检查我的php.ini.it all ready set on.allow_url_fopen=on