php reCAPTCHA没有显示

时间:2014-05-09 15:40:06

标签: php recaptcha

我正在尝试将reCAPTCHA添加到我的php / html网站。但它没有显示。我已经下载了库并设置了我的网站,所以我有公钥和私钥。我已经创建了一个基本页面来尝试让它工作,但仍然没有运气。这是我的PHP代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require_once('lib/recaptchalib.php');
?>
<title>Test odds and ends</title>
</head>
<body>
<form method="post" action="">
<?php
 $publickey = "~hidden~";
 echo recaptcha_get_html($publickey);
?>
</form>
</body>
</html>  

页面显示为完全空白。制作的html是:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test odds and ends</title>
</head>
<body>
<form method="post" action="">
<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=~hidden~">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=~hidden~" height="300" width="500" frameborder="0">
</iframe><br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>
</form>
</body>
</html>  

有谁知道为什么这不起作用?非常感谢提前。

0 个答案:

没有答案