当在recaptcha 中输入安全词并单击Submit 按钮时,PHP 安全电子邮件功能将被执行——即使recaptcha 验证失败并返回错误消息。基本代码如下。我该怎么做才能不执行电子邮件功能?谢谢你。
<form name="contactform" method="POST" onSubmit="return validateCaptcha()"
action="send_form_email.php">
</form>
<script type="text/javascript">
jQuery(document).ready(function (){
Recaptcha.create(" --- my key ---_",
"recpatcha_show",
{
theme: "red",
callback: Recaptcha.focus_response_field
}
);
});
</script>
<div id="recpatcha_show"></div>
<div id="captchaStatus" style="color:red;font:16px;"></div>
<br />
<input type="submit" value="Submit"><a href="http://www.--- my url base ---/email_form.php "></a>