Using reCAPTCHA on localhost

2020-01-25 03:16发布

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.

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

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

17条回答
贪生不怕死
2楼-- · 2020-01-25 03:54

https://developers.google.com/recaptcha/docs/domain_validation

Check the part where it says you can disable the check. Only do it for development.

查看更多
\"骚年 ilove
3楼-- · 2020-01-25 03:54

localhost works now. However, remember that after adding localhost to list of domain names, it takes up to 30 minutes to take effect (according to the help tip shown against the domain names list).

查看更多
疯言疯语
4楼-- · 2020-01-25 03:54
  1. Register your website at – https://www.google.com/recaptcha/admin
  2. add js plugin 3.add class and your site-key provived by google enter image description here
<script src='https://www.google.com/recaptcha/api.js'></script>
 <div class="g-recaptcha" data-sitekey="your site-key"></div>
查看更多
叼着烟拽天下
5楼-- · 2020-01-25 03:55

This worked for me:

"With the following test keys, you will always get No CAPTCHA and all verification requests will pass.

Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI

Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe

The reCAPTCHA widget will show a warning message to claim that it's only for testing purpose. Please do not use these keys for your production traffic."

Extracted from here: https://developers.google.com/recaptcha/docs/faq

BR!

查看更多
够拽才男人
6楼-- · 2020-01-25 03:55

when you add Domains in Google recaptcha

Add new domain: Localhost not localhost

"L" is capital letter

Good luck

查看更多
孤傲高冷的网名
7楼-- · 2020-01-25 03:55

Remove current REcaptcha key, then register new key and set your key settings with domains: 127.0.0.1 localhost

查看更多
登录 后发表回答