简体   繁体   English

PHP Recaptcha表单仅适用于IP地址,而不适用于www.google.com。

[英]PHP Recaptcha Form only Works with IP Address instead of www.google.com

As mentioned in the title. 如标题中所述。 My recaptcha form only works if I change this: 我的Recaptcha表单仅在以下情况下有效:

define("RECAPTCHA_VERIFY_SERVER", "www.google.com");

to this: 对此:

define("RECAPTCHA_VERIFY_SERVER", "74.125.236.178");

I am using myhosting.com vps linux server. 我正在使用myhosting.com vps linux服务器。 Any idea why it doesn't work with www.google.com ? 知道为什么它不适用于www.google.com吗?

Fix to this problem is, 解决此问题的方法是,

//line 40 in recpatchalib.php and replace:
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");

// With this:
define("RECAPTCHA_VERIFY_SERVER", gethostbyname('api-verify.recaptcha.net'));

Try it. 试试吧。

Got from Issues page. 从“ 问题”页面获得。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用PHP格式化URL - http://www.google.com到www.google.com/; 也有str_replace()的问题 - Format URL using PHP - http://www.google.com to www.google.com/; Also having trouble with str_replace() 配置curl以获取www.google.com - configure curl to get www.google.com file_get_contents(https://www.google.com/recaptcha/api/siteverify):无法打开 stream:连接超时 - file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: Connection timed out PHP服务器访问https://www.google.com/movies没有结果 - PHP server hitting https://www.google.com/movies gets no results PHP cURL 使用 HTTPS 网站的代理,例如“www.google.com” - PHP cURL use proxy to HTTPS website for example “www.google.com” fsockopen()无法连接到www.google.com:80 - fsockopen() unable to connect to www.google.com:80 iframe解决方法,可在Webkit浏览器中加载http://www.google.com - iframe workaround to load http://www.google.com in a webkit browser 我需要一个用于验证“ www.google.com”和“ http://google.com”的正则表达式 - I need a single regular expression that validates both “www.google.com” and “http://google.com” PHP表单+ Google reCAPTCHA - PHP form + Google reCAPTCHA 我如何CURL www.google.com-它不断将我重定向到.co.uk - How do I CURL www.google.com - it keeps redirecting me to .co.uk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM