0

我现在正在使用dform 插件来创建表单。创建普通字段工作正常。是否有任何可用于包含 CAPTCHA 的 dform 插件?创建 dforms 只需要 json 文件和脚本文件。我们如何将 CAPTCHA 添加到其中?我使用 PHP 作为服务器端脚本语言。

4

1 回答 1

1

Recaptcha是一个可以与任何形式一起使用的插件

可以在这里找到http://www.google.com/recaptcha

这是有关如何设置它的示例代码http://code.google.com/p/recaptcha/wiki/HowToSetUpRecaptcha

<script type="text/javascript"
   src="https://www.google.com/recaptcha/api/challenge?k=YOUR_PUBLIC_KEY"
 </script>
 <noscript>
   <iframe src="https://www.google.com/recaptcha/api/noscript?k=YOUR_PUBLIC_KEY"
       height="300" width="500" frameborder="0"></iframe><br>
 </noscript>


 require_once('recaptchalib.php');
  $publickey = "YOUR_PUBLIC_KEY"; // You got this from the signup page.
  echo recaptcha_get_html($publickey);
With the code, your form might look something like this:

<!-- your HTML content -->
 <form method="post" action="verify.php">
   <?php
     require_once('recaptchalib.php');
     $publickey = "YOUR_PUBLIC_KEY"; // you got this from the signup page
     echo recaptcha_get_html($publickey);
   ?>
   <input type="submit" />
 </form><br>
<!-- more of your HTML content -->
于 2013-09-20T08:58:29.753 回答