<div class="row">
\t \t \t \t \t \t <div class="col-xs-12 col-lg-10 col-lg-offset-1">
\t \t \t \t \t \t \t <form method="post" action="" name="contactForm" id="contactform" class="clearfix">
\t \t \t \t \t \t \t \t <fieldset>
\t \t \t \t \t \t \t \t \t <div class="float-left">
\t \t \t \t \t \t \t \t \t \t <div class="coolfx fadeInUp">
\t \t \t \t \t \t \t \t \t \t \t <!--<span>*Name<label for="name"></label></span>-->
\t \t \t \t \t \t \t \t \t \t \t <span><input type="text" id="contactName" name="name" placeholder="*Name" class="text" required></span>
\t \t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t \t \t <div class="coolfx fadeInUp" >
\t \t \t \t \t \t \t \t \t \t \t <!--<span>*Email<label for="email"></label></span>-->
\t \t \t \t \t \t \t \t \t \t \t <span><input type="email" id="contactEmail" name="email" placeholder="*Email" class="email" required></span>
\t \t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t \t \t <div class="coolfx fadeInUp">
\t \t \t \t \t \t \t \t \t \t \t <!--<span>Phone<label for="phone"></label></span>-->
\t \t \t \t \t \t \t \t \t \t \t <span><input type="text" id="contactPhone" name="phonenumber" placeholder="Phone" class="text" required></span>
\t \t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t \t <div class="float-right">
\t \t \t \t \t \t \t \t \t \t <div class="contactform message coolfx fadeInUp">
\t \t \t \t \t \t \t \t \t \t \t <!--<span>Message<label for="message"></label></span>-->
\t \t \t \t \t \t \t \t \t \t \t <span><textarea id="contactMessage" placeholder="*Message" name="message" class="textarea" required></textarea></span>
\t \t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t \t </div>
\t \t \t \t \t \t \t \t </fieldset>
\t \t \t \t \t \t \t <div class="float-right"><div class="g-recaptcha" data-sitekey="6LfsPBgTAAAAAPDkaI1HeSyDm_ecF0iihVsFYBKh"></div></div>
\t \t \t \t \t \t \t \t <div class="coolfx fadeInUp">
\t \t \t \t \t \t \t \t \t <input name="send" type="submit" class="submit" id="submit" value="Send Email">
\t \t \t \t \t \t \t \t </div>
<?php
if(isset($_POST['g-recaptcha-response']))
$url = 'https://www.google.com/recaptcha/api/siteverify';
$privatekey = "******************************";// hide for security
$response = file_get_contents($url."?secret=".$privatekey."&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']);
$data = json_decode($response);
if (isset($data->success) AND $data->success==true) {?>
<script type="text/javascript">
$(function() {
$("#contactform .submit").click(function() {
var data = {
name: $("#contactName").val(),
email: $("#contactEmail").val(),
phone: $("#contactPhone").val(),
message: $("#contactMessage").val()
};
$.ajax({
type: "POST",
url: "email.php",
data: data,
success: function(){
$('.success').fadeIn(1000);
}
});
});
});
</script>
<?php }else {
echo"this is spam"
}?>
我是新j中查詢如何使用PHP代碼內Ĵ查詢代碼,以及如何前驗證谷歌驗證碼驗證碼提交郵件功能無效。
之前谷歌驗證碼正常工作我的代碼,但現在沒有工作。
謝謝
請格式化您的代碼,以便我們瞭解正在發生的事情。 –
現在請檢查 – rao0088
我想在這裏檢查只有當captcha工作,然後將信息發送到郵件頁面 – rao0088