Add Google's reCAPTCHA verification code to the site to enhance validation

Source: Internet
Author: User

First Step Registration

The second step is to embed the code in the relevant web page after getting to the API

First, type the code into the template, which is the form submission page report.php the template

<tr>
<td height= "" ">Captcha</td>
<td height=" ><?php
Requir E_once ('.. /.. /..          /skin/google/recaptchalib.php ');
$publickey = "Fill in your application for the Apikey 、、、 public Key";
echo recaptcha_get_html ($publickey);
?></td>
</tr>

The next step is to post to the relevant page and add the code

E/enews/index.php at the top of the code

 <?php require_once ('.. /..
/skin/google/recaptchalib.php ');
  $privatekey = "Write your application key here";   $RESP = Recaptcha_check_answer ($privatekey,                                   $_server["REMOTE_ADDR"],                                   $_post["Recaptcha_challenge_field"],                              

    $_post["Recaptcha_response_field"]);   if (! $resp->is_valid) {    die ("incorrect!! <a href= ' # ' onclick= ' Javascript:history.back (-1); ' 
>click to Back!</a> ".          "(reCAPTCHA said:".) $resp->error.
")");  } 

The last thing you need to download here is a file that is used in the file above recaptchalib.php

Put it in the relevant file directory, OK?

The next few days to see if the effect is not slightly.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.