[英]create dynamic time in php and mysql
我是第一次在網站上使用Google ReCaptcha並通過此鏈接下載。
google ReCaptcha在我的表單上工作正常,但是每當用戶按下按鈕表單時,都轉到其他鏈接。 我需要將此Google ReCaptcha設為必需。 請解決這個。謝謝
<?php
require_once "recaptchalib.php";
$siteKey = "Site key";
$secret = "Secret key";
$lang = "en";
$resp = null;
$error = null;
$reCaptcha = new ReCaptcha($secret);
if(isset($_POST["g-recaptcha-response"])) {
$resp = $reCaptcha->verifyResponse(
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
?>
<html>
<head><title>reCAPTCHA Example</title></head>
<body>
<?php
if ($resp != null && $resp->success) {
echo "You got it!";
}
?>
<form method="post">
<div class="g-recaptcha" data-sitekey="<?php echo $siteKey;?>"></div>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=<?php echo $lang;?>"></script>
<br/>
<input type="submit" value="submit" />
</form>
</body>
</html>
我認為您是配置錯誤的reCaptcha代碼,請檢查以下鏈接並重新設置您的代碼
https://code.google.com/p/recaptcha/wiki/HowToSetUpRecaptcha#PHP
對於錯誤的驗證碼顯示錯誤消息,請使用鏈接http://mycodde.blogspot.com/2014/12/new-checkbox-recaptcha-tutorial-with.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.