jquery recaptcha php

发布于 2024-10-18 12:35:10 字数 1079 浏览 1 评论 0原文

我不知道如何通过 jQuery 验证 recaptcha 的事情。请帮忙。我有包含以下字段的联系我们表单:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>


<script type="text/javascript">

$(document).ready(function() {

$('#signup').validate({
rules: {
name: {
required: true
},
email: {
required: true,
email: true
},
messages: {
name: {
required: 'FULL NAME Missing'
},
email: {
required: "E-MAIL ADDRESS Missing",
email: "E-MAIL ADDRESS Not Valid"
}

});



});


</script>

<form action="index.php" method="post" name="signup" id="signup">
<p>
Full Name
<br>
<input name="name" type="text" class="required" id="name" title="Type your Full Name into this box" value="<?php echo $_POST['name']; ?>">
</p>
<p>
E-Mail Address
<br>
<input name="email" type="text" id="email" title="Type your E-Mail Address into this box" value="<?php echo $_POST['email']; ?>">


</form>

使用 jQuery 进行验证正在工作,但不知道如何在其中实现 recaptcha。

I don't know how can i validate the recaptcha thing via jQuery. Please help. I have the contact us form with the following fields:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>


<script type="text/javascript">

$(document).ready(function() {

$('#signup').validate({
rules: {
name: {
required: true
},
email: {
required: true,
email: true
},
messages: {
name: {
required: 'FULL NAME Missing'
},
email: {
required: "E-MAIL ADDRESS Missing",
email: "E-MAIL ADDRESS Not Valid"
}

});



});


</script>

<form action="index.php" method="post" name="signup" id="signup">
<p>
Full Name
<br>
<input name="name" type="text" class="required" id="name" title="Type your Full Name into this box" value="<?php echo $_POST['name']; ?>">
</p>
<p>
E-Mail Address
<br>
<input name="email" type="text" id="email" title="Type your E-Mail Address into this box" value="<?php echo $_POST['email']; ?>">


</form>

Validation with the jQuery is working, but no idea how to implement the recaptcha into this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拒绝两难 2024-10-25 12:35:10

感谢大家的评论,将通过简单的库完成它:)

http://www.white-hat-web-design.co.uk/articles/php-captcha.php

提交表单后使用 php 进行验证(对我来说很容易实现) php 的时间比 jquery 少:)。

特别感谢菲利克斯·克林:)。

戴夫

thanks all for your comments,will get it done by simple library :)

http://www.white-hat-web-design.co.uk/articles/php-captcha.php

And validation by using php after submitting of the form (it was easy for me to implement in less time in php than jquery. :) .

special thanks to Felix Kling :).

Dave

不打扰别人 2024-10-25 12:35:10

对于此类验证,jQuery validate 插件中有一个名为 remote 的验证方法。

此处检查

$("#myform").validate({
  rules: {
    email: {
      required: true,
      email: true,
      remote: "check-email.php"
    }
  }
});

check-email.php应返回字符串“true”才被视为有效。和字符串“false”被认为是假的。

For those sort of validate, there is a validation method in jQuery validate plugin known as remote.

Check it here

$("#myform").validate({
  rules: {
    email: {
      required: true,
      email: true,
      remote: "check-email.php"
    }
  }
});

In this check-email.php should return string "true" to be considered valid. and string "false" to be considered false.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文