如果你能帮助我,我真的很感激。
我有一个以这个按钮结尾的表单:
<button type="submit" value="Create" name="new">Create</button>
然后 PHP 使用以下方法对其进行处理:
if(isset($_POST['new']) && $_POST['new'] == "Create")
所以我正在尝试向其中添加 reCAPTCHA,并且我有这段代码:
<?php
require_once('recaptchalib.php'); // reCAPTCHA Library
$pubkey = ""; // Public API Key
$privkey = ""; // Private API Key
if ($_POST['doVerify']) {
$verify = recaptcha_check_answer($privkey, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
if ($verify->is_valid) {
# Enter Success Code
//process form
}
else {
# Enter Failure Code
echo "You did not enter the correct words. Please try again.";
}
}
?>
但我不知道如何链接它们。
谢谢指教!