-->



Sunday, October 11, 2015

Codeigniter--Google reCaptcha-login form

After the Simple Application, We are going to learn about Google reCaptcha-login form.

1.   Rename your Codeigniter folder as "captchaigniter".

2.   Now configure your files.Go to C:\xampp\htdocs\captchaigniter\application\config  and select       autoload.php and make changes as follows.

                  $autoload['libraries'] = array('xmlrpc');
                  $autoload['helper'] = array('url', 'file','form');

3.  Select config.php and make the changes as follows.

                   $config['base_url'] = 'http://localhost/CaptchaIgniter/';

4.  Select routes.php and make the changes as follows.

                    $route['default_controller'] = "user_controller";
                    $route['404_override'] = '';
                    $route['login'] = "/user_controller/login";
  
5.  First we need to create the google reCaptcha key.So, click here. After signing in,you will get a            screen like this.

                               

                   
6.  when you fill the required details in the above form, you will be provided with the secret key.

7.  Create a new file login.php in C:\xampp\htdocs\CaptchaIgniter\application\views.Copy and        paste the code given below.

                                           login.php

                         


8.  Create a new file user_controller.php in C:\xampp\htdocs\CaptchaIgniter\application\controllers.
     Copy and paste the code given below.

                                          user_controller.php




9.  Now download the curl library to connect with google captcha API to verify from abusive or spam      activities on your site. you can place it here C:\xampp\htdocs\CaptchaIgniter.

10. Finally redirect the url as http://localhost/CaptchaIgniter/. You will get the following screen.

                     


     That's it!, You got your own Google reCaptcha form. In Next tutorial,we will be learning about MD5 login form.



No comments:

Post a Comment