Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为什么需要回应;重述“获取html”吗;?_Php_Html_Css_Recaptcha - Fatal编程技术网

Php 为什么需要回应;重述“获取html”吗;?

Php 为什么需要回应;重述“获取html”吗;?,php,html,css,recaptcha,Php,Html,Css,Recaptcha,全部。我一直在尝试集成Google的reCAPTCHA,但在尝试回显reCAPTCHA_get_html时似乎失败了。它出现了一个未定义的函数错误。我到处找了,似乎找不到一个直截了当的答案。我对PHP有点了解,但并不完全了解所有内容。有人能解释一下我如何找到缺失的函数吗。所以我的问题是,是否需要响应这个函数?。这是我的密码: <form class="" action="verify.php" method="post"> <input type="text"

全部。我一直在尝试集成Google的reCAPTCHA,但在尝试回显reCAPTCHA_get_html时似乎失败了。它出现了一个未定义的函数错误。我到处找了,似乎找不到一个直截了当的答案。我对PHP有点了解,但并不完全了解所有内容。有人能解释一下我如何找到缺失的函数吗。所以我的问题是,是否需要响应这个函数?。这是我的密码:

  <form class="" action="verify.php" method="post">
      <input type="text" name="email" value=" enter email address" onFocus="if(this.value==' enter email address')this.value='';" style="height:18px; width:218px; color: #cccccc; border: 1 solid #000000; background-color: #5e5e5e; font: xx-small Verdana">
      &nbsp; <br><br>
      <?php
        require_once('recaptchalib.php');
        $publickey = "// Public Key";
        echo recaptcha_get_html($publickey);
      ?>
      <br>
      <input type="submit" id="sendform" name='send' value="   send   " style="cursor: hand; height:18px; border: 1 solid #000000; background-color:#5e5e5e; color: #cccccc; font: xx-small Verdana; font-weight:bold">
    </form>





提前感谢。

您使用的是不再受支持的1.0版:
好的,首先,不,您不需要回显该功能! 正如J-H所说,您可能首先要更新到最新版本的recaptcha。 下面是我如何在php中实现GoogleReCAPTCHA

$secret = "Your secret key";
$reCaptcha = new ReCaptcha($secret);
    if ($_POST["g-recaptcha-response"]) {
        $response = $reCaptcha->verifyResponse ( 
   $_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"]);
    }

    if(!($response != null && $response->success)) ...
      //it was successfully
注意我怎么没有回应任何东西。此外,公钥应该在html中,私钥应该在PHP中。公钥不应该在PHP中,我不知道这是否是一个输入错误,但这也可能是另一个问题。最后,您似乎没有正确地为google recaptcha api使用html,至少是新api。 包括
在标题和

您希望在其中显示recaptcha。那你就可以让一切顺利了。干杯

更多的是评论而不是回答,你不认为吗?上次我检查客户端完全基于JavaScript:客户端工作正常,只是没有得到验证,因为客户端说他们仍然收到垃圾邮件。而verify.php似乎没有提供任何反馈。