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

查看:45
本文介绍了在本地主机上使用 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 going to put it on some domain.

reCAPTCHA 网站中,据说该插件只能在给定的情况下工作域(和子域).

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

有没有办法在本地主机上使用 reCAPTCHA 插件?

Is there a 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天全站免登陆