热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

将验证码添加到drupal7实体表单中-Addingcaptchatodrupal7entityforms

Ineedtoaddacaptchatoaformcreatedwithentityformsindrupal7.Icantfindanyinfoonhow

I need to add a captcha to a form created with entityforms in drupal 7. I can't find any info on how to do this. Can anyone tell me how this is done?

我需要在drupal 7中使用entityforms创建的表单添加验证码。我找不到有关如何执行此操作的任何信息。谁能告诉我这是怎么做到的?

4 个解决方案

#1


1  

Try this module it will works...

试试这个模块它会起作用......

https://drupal.org/project/captcha

https://drupal.org/project/captcha

#2


1  

  1. Install module https://drupal.org/project/captcha
  2. 安装模块https://drupal.org/project/captcha
  3. Goto entityform form.
  4. 转到entityform表单。
  5. On firebug view form source. And copy value from field:
  6. 在firebug视图表单源。并从字段中复制值:
  7. Goto /admin/config/people/captcha and FORM_ID from early copyed value.
  8. 从早期复制值转到/ admin / config / people / captcha和FORM_ID。

#3


0  

Another useful Module is the Spamicide Module.

另一个有用的模块是Spamicide模块。

Spamicide adds an input field to each form then hides it with css, when spam bots fill in the field the form is discarded.

Spamicide为每个表单添加一个输入字段,然后用css隐藏它,当垃圾邮件机器人填写该字段时,表单将被丢弃。

You can turn on this functionality on every Form in Drupal.

您可以在Drupal中的每个表单上启用此功能。

#4


0  

To add a CAPTCHA to an Entityform Type in Drupal:

要将一个CAPTCHA添加到Drupal中的Entityform类型:

  1. Install or enable the contributed Captcha module.

    安装或启用提供的Captcha模块。

  2. Determine which Entityform Type(s) you want a CAPTCHA added to:

    确定要将CAPTCHA添加到哪个Entityform类型:

    Admin > Structure > Entityform Types
    admin/structure/entityform_types

    管理>结构>实体形式类型admin / structure / entityform_types

  3. From the list of Entityform Types, copy the Machine Name of the Entityform Type (e.g. contact_us).

    从实体形式类型列表中,复制实体形式类型的机器名称(例如contact_us)。

  4. Configure the Captcha module:

    配置Captcha模块:

    Admin > Configuration > People > CAPTCHA
    admin/config/people/captcha

    管理员>配置>人员> CAPTCHA admin / config / people / captcha

  5. Within the Form Protection fieldset, add the Machine Name* of the Entityform Type as the Form ID value.

    在“表单保护”字段集中,将“实体形式类型”的“机器名称*”添加为“表单ID”值。

    *Note: the Form ID expected by the Captcha module is the Entityform Type machine name appended with the string of text _entityform_edit_form.

    *注意:Captcha模块预期的表单ID是附加了文本字符串_entityform_edit_form的Entityform Type计算机名称。

    For instance, if your Entityform Type machine name is contact_us, the complete Form ID would be contact_us_entityform_edit_form.

    例如,如果您的Entityform Type计算机名称为contact_us,则完整的表单ID将为contact_us_entityform_edit_form。

    You can verify this by viewing the HTML source of an Entityform Type and cross-referencing the form's ID attribute:

    您可以通过查看Entityform类型的HTML源并交叉引用表单的ID属性来验证这一点:

    Keep in mind, the actual value has hyphens replaced with underscores, as common in Drupal.

    请记住,实际值的连字符替换为下划线,这在Drupal中很常见。

  6. Select the appropriate Challenge Type or use the defaults.

    选择适当的挑战类型或使用默认值。

  7. Save the Captcha configuration changes.

    保存Captcha配置更改。

To verify the CAPTCHA has been successfully added, open a private browsing session (e.g. a Chrome Incognito window) and view the Entityform Type, or simply view the form while logged-out of Drupal.

要验证是否已成功添加CAPTCHA,请打开隐私浏览会话(例如Chrome隐身窗口)并查看Entityform类型,或者只是在退出Drupal时查看表单。


推荐阅读
author-avatar
babe
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有