谷歌版ReCAPTCHA我有一些領域的一個PHP的形式和谷歌在數據庫表ReCAPTCHA技術領域和價值商店,但我想使所需的谷歌ReCAPTCHA技術領域。 代碼在這裏:如何使需要在PHP
<?PHP
if(isset($_POST['submit']))
{
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message=$_REQUEST['message'];
$user_id=$_SESSION['id'];
$sql="insert into contact (name,email,message,user_id,status)
values('$name','$email','$message','$user_id','1')";
$qex=mysql_query($sql);
if(!$qex)
{
die("Contact information is not Added".mysql_error());
}
$msgsec="Contact information is Added";
?>
表單代碼:
<script src='https://www.google.com/recaptcha/api.js'></script>
<form id='contactus' method='post' >
<input type='hidden' name='submit' id='submit' value='1'/>
<label><h2>Your Name <strong style="color:red">*</strong></h2></label>
<input type="text" class="form-control" required name="name" id="name" placeholder="Please enter you'r name"/>
<label><h2>Your Email <strong style="color:red">*</strong></h2></label>
<input type="email" class="form-control" required name="email" id="email" placeholder="Please enter you'r email address"/>
<label><h2>Your Message <strong style="color:red">*</strong></h2></label>
<textarea class="form-control" required name="message" id="message" placeholder="Please type you'r message here"></textarea>
<br />
<div class='container'>
<div class="g-recaptcha" data-sitekey="6LevWB0UAAAAAEPIUh40HptW3PxfYFqjvz2Wa05D"></div>
</div>
<div class='container'>
<input type="submit" name="submit" class="btn btn-primary" value="SEND MESSAGE">
</div>
</form>
截至目前不需要谷歌ReCAPTCHA技術選項。表單詳細信息始終與提交按鈕存儲在一起,然後單擊captcha或不。我想要製作Google ReCAPTCHA。請檢查我的代碼並讓我知道。我錯過了什麼。
感謝和問候。 ANKIT
阿賈克斯將在這裏是一個有效的解決方案。 [作出要求谷歌ReCAPTCHA技術怎麼樣?] – Akintunde007
的可能的複製(http://stackoverflow.com/questions/29612879/google-recaptcha-how-to-make-required) –
使用複選框服務器端[新谷歌驗證碼的可能的複製PHP(http://stackoverflow.com/questions/27274157/new-google-recaptcha-with-checkbox-server-side-php) –