在本地主机上使用reCAPTCHA [英] Using reCAPTCHA on localhost

查看:387
本文介绍了在本地主机上使用reCAPTCHA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP开发网站,并且希望在其中一个环节中进行人工验证.为了进行开发,我最初是在本地运行该系统,当它准备就绪时,我将把它安装在某个域中.

I'm developing a website using PHP and I want to make a human verification in one of the sessions. For the development, I'm initially running the system locally and when it is ready, I'm gonna make put it on in a certain domain.

reCAPTCHA网站中,据说该插件仅在给定的条件下有效域(和子域).

In the reCAPTCHA website it is said that the plugin will only work at the given domain (and subdomains).

我的问题是:有什么方法可以在本地主机上使用reCAPTCHA插件?

My question is: Is there any way to use the reCAPTCHA plugin on a localhost?

推荐答案

更新

原始答案不再正确.现在,开发人员指南指出:

Update

The original answer is no longer correct. The developer's guide now states:

如果要使用"localhost"进行开发,则必须将其添加到域列表中."

"If you would like to use "localhost" for development, you must add it to the list of domains."

这仅在您使用127.0.0.1/...而不是localhost/...访问localhost时有效.

This will only work if you access localhost using 127.0.0.1/... rather than localhost/....

原始答案保存在下面.

根据 reCAPTCHA开发人员指南:

默认情况下,不再支持

"localhost域.如果希望继续支持它们进行开发,则可以将其添加到站点密钥支持的域列表中.转到管理控制台以更新支持的域列表.我们建议使用单独的密钥进行开发和生产,并且不要在生产站点密钥上使用localhost."

"localhost domains are no longer supported by default. If you wish to continue supporting them for development you can add them to the list of supported domains for your site key. Go to the admin console to update your list of supported domains. We advise to use a separate key for development and production and to not allow localhost on your production site key."

换句话说,只需使用相同的键即可.

In other words, simply use the same key.

这篇关于在本地主机上使用reCAPTCHA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆