-->



Wednesday, October 14, 2015

Codeigniter--Cross-site Scripting

After Image-uploading, We will be learning about Cross-site Scripting.

1.  Rename your Codeigniter folder as "ScriptIgniter".

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

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

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

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

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

                    $route['default_controller'] = "form_controller";
                    $route['404_override'] = '';

5.  Create a new folder named "css" in C:\xampp\htdocs\ScriptIgniter.

6.  Now create a new file form_controller.php in C:\xampp\htdocs\ScriptIgniter\application\controllers
     and copy and paste the code given below.

                                                form_controller

                               
      

7.  Now create a new file form_view.php in C:\xampp\htdocs\ScriptIgniter\application\views and copy and paste the code given below.

                                             form_view.php


      

8.  Create a new file style.css in C:\xampp\htdocs\ScriptIgniter\css. Copy and paste the code given below.

                                                  style.css


       

9.  Now navigate url to http://localhost/ScriptIgniter/index.php/form/data_submitted. You should get the screen like this.

                                         


10. That's it!!, We have successfully learned about Cross-site Scripting. In the next tutorial, we will be learning about Captcha-generated form.

Codeigniter--Image-upload

After Encrption and Decryption of data, we will be learning about Image uploading.

1.  Rename your Codeigniter folder as "UploadIgniter".

2.  Now configure your files.Go to C:\xampp\htdocs\UploadIgniter\application\config. 
     Now 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/UploadIgniter/';

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

                    $route['default_controller'] = "upload_controller";
                    $route['404_override'] = '';

5.  Create a new folder named "css" in C:\xampp\htdocs\UploadIgniter.

6.  Create a new folder named "uploads" in C:\xampp\htdocs\UploadIgniter.

7.  Now create a new file upload_controller.php in                                                                                C:\xampp\htdocs\UploadIgniter\application\controllers. Copy and paste the code given below.


                                        upload_controller.php

      

8.  Now create a new file upload_view.php in                                                                                        C:\xampp\htdocs\UploadIgniter\application\views. Copy and paste the code given below.

                                           upload_view.php




9.  Now create a new file upload_success.php in                                                                                    C:\xampp\htdocs\UploadIgniter\application\views. Copy and paste the code given below.

                                           upload_success.php



10. Now create a new file style.css in C:\xampp\htdocs\UploadIgniter\css. Copy and paste the code given below.

                                              style.css




10. Finally redirect the url to http://localhost/UploadIgniter/. You should get a screen like this.

                     

11. That's it!!, We have successfully created the Image-uploading form.In the next tutorial, we will be learning about Cross-site Scripting.

Monday, October 12, 2015

Codeigniter--Encryption & Decryption of Data

After Dynamic Calender, We will be learning about encryption and Decryption in Data.

1.  Rename your Codeigniter folder as "EncIgniter".

2.  Now configure your files.Go to C:\xampp\htdocs\EncIgniter\application\config. 
     Now 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/EncIgniter/';

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

                    $route['default_controller'] = "encrypt_ctrl";
                    $route['404_override'] = '';

5.  Create a new folder named "css" in C:\xampp\htdocs\EncIgniter.

6.  Now create a new file encrypt_ctrl.php in C:\xampp\htdocs\EncIgniter\application\controllers.Copy      and paste the code given below.

                                           encrypt_ctrl.php

      

                            
7.  Create another file encrypt_view.php  in C:\xampp\htdocs\EncIgniter\application\views.Copy and paste the code given below.

                                        encrypt_view.php

       

                                  
8.  Create a new file style.css and save it in C:\xampp\htdocs\EncIgniter\css. Copy and paste the code given below.

                                             style.css

                                                
       

9.  Finally navigate your url to http://localhost/EncIgniter/. You should get the following screen.

                     

10. That's it!! we successfully developed an encryption and decryption-data application. In our next tutorial we will be learning about Image Uploading.



Codeigniter--Dynamic-Calender

After MD5 login-form, We will be learning about creating Dynamic Calendar.

1.  Rename your Codeigniter folder as "CalenIgniter".

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

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

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

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

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

                    $route['default_controller'] = "calender_control";
                    $route['404_override'] = '';

5.  Create a new folder named "css" in C:\xampp\htdocs\CalenIgniter.

6.  Create a new file control_calender.php in C:\xampp\htdocs\CalenIgniter\application\controllers
     and copy and paste the given code below.

                                                  control_calender.php

                         
      

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

                                            view_calender.php


                         

8.  Create a new file styles.css in C:\xampp\htdocs\CalenIgniter\css. Copy and paste the code given below.
               
                                                          styles.css


        

9.  Now navigate the link to http://localhost/CalenIgniter/. You should get the following screen.

                       

10. That's it!!, we have successfully finished developing a dynamic calendar. In the next tutorial, we will be learning about encryption and decryption in data.

Codeigniter--MD5 login form

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

1.   Rename your Codeigniter folder as "MD5Igniter".

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

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

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

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

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

                    $route['default_controller'] = "login";
                    $route['404_override'] = '';
     
5.   Next select database.php and make changes as follows.

           $db['default']['hostname'] = 'localhost';
           $db['default']['username'] = 'root';
           $db['default']['password'] = '';
           $db['default']['database'] = 'db_md5';
           $db['default']['dbdriver'] = 'mysql';     

6.  Coming to the database table part, copy and paste the following code.

                     
                 

7.  Your database table part should look like this.

                   

8.  While inserting data into  the database, just choose "MD5" in the userpassword column like this.

                         

9.  After inserting data, your table should look like this.
     Password for "harsha" is "blader" and "hari"  is "harish".
 
                                                   

10. Create a new file login.php in C:\xampp\htdocs\MD5Igniter\application\controllers.
      Copy and   paste the code given below.

                                                 login.php
             




11. Create a new file view_login.php in C:\xampp\htdocs\MD5Igniter\application\views.
      Copy and   paste the code below.

                                              view_login.php

       

12. Create a new file view_welcome.php in C:\xampp\htdocs\MD5Igniter\application\views.
      Copy and  paste the code below.

                                              view_welcome.php

                     
                         

13. Now redirect url as http://localhost/MD5Igniter/. You should get the following screen.

                                   

That's it!!, we have successfully created the MD5 login form.In the next tutorial, we will be learning about  creating calendar dynamically.

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.



Saturday, October 10, 2015

Codeigniter--Inserting data into database

After the Cross-site Scripting Application, Now we are going to learn about Inserting data into the database.

1.  Rename your Codeigniter folder as "inserigniter".
2.  Now configure your files.Go to C:\xampp\htdocs\insertigniter\application\config  and select  autoload.php and make changes as follows.

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

3.  Here xmlrpc is  a way for two computers to communicate over the internet using XML.
4.  Next select database.php and make changes as follows.

           $db['default']['hostname'] = 'localhost';
           $db['default']['username'] = 'root';
           $db['default']['password'] = '';
           $db['default']['database'] = 'company_db';
           $db['default']['dbdriver'] = 'mysql';

5.  Create a new file view.php in C:\xampp\htdocs\insertigniter\application\views.Here is the code. Just copy and paste it in your file.    

                                                         view.php




6.  Create a new file vcontroller.php in C:\xampp\htdocs\insertigniter\application\controllers.Here is the code. Just copy and paste it in your file.

                                                      vcontroller.php




7.  Create a new file model.php in C:\xampp\htdocs\insertigniter\application\models.Here is the code. Just copy and paste it.

                                                  model.php

                      

8.Create a css folder in C:\xampp\htdocs\insertigniter and create a file named styles.css. Just copy and paste the following code.

                                                     styles.css

                             


9.  For the database part, just copy and paste in your database.

           

10. Now redirect to http://localhost/insertigniter/index.php/vcontroller.
11. You should get the following screen.

                               



That's it!,In the next tutorial,we will be learning about Captcha-generated Form.

Codeigniter-Simple Application

After Configuring the files, We are all set to develop a simple application.


 The simple application is displaying "Hello World!!".It sounds funny, but to display these two            words in Codeigniter we are going to use View and Controller.So lets proceed with the tutorial.

1. Now go to your Codeigniter application folder and change the name of the folder as projectigniter     and  go to C:\xampp\htdocs\projectigniter\application\config and click on routes.php  and  make    the following changes.

                   $route['default_controller'] = "";   
                    as    
                   $route['default_controller'] = "hello_controller";

2. Include "url" in autoload.php in the helper.
 
                   $autoload['helper'] = array('url');

3. Now create a page hello_contoller.php within \xampp\htdocs\projectigniter\application\controllers.
4. Just copy and paste the code given bellow.
   
                                  hello_controller.php                                                                                          
         

5. Next create a page words_view.php within \xampp\htdocs\projectigniter\application\controllers.
6. Copy and paste the words given bellow.

                                      words_view.php

              

7. Now the application in your browser as http://localhost/projectigniter/.
8. You should get the screen as below.

     
 


That's all!!, We have successfully developed  our first and simple application.In our next tutorial we will be learning about google Recaptcha-login form.

Friday, October 9, 2015

Codeigniter--Configuring Files

After Installation Concept, We will be learning about how to Configure Codeigniter files.

The Codeigniter Framework can't be used as it. Because the files in the Codeigniter folder must be configured and its a mandatory. So in this tutorial, we are going to learn about configuring the files.

1. Go to C:\xampp\htdocs\yourCIfolder\application\config and select autoload.php. In this file, you will find $autoload['libraries'] = array();. libraries like xmlrpc, database, and session are to be loaded in it.

autoload.php


2. In the same autoload.php  file, you will find $autoload['helper'] = array();.  Helpers like url, file, and form should be included.

autoload.php
  
3. Again in autoload.php, you will find $autoload['model'] = array();. Files with models(eg. file_model.php) will be included in it.

autoload.php
4.  In the same config folder, you will find another file named config.php.  When you scroll down, you will find $config['encryption_key'] = '';. When you are using the session and Encryption in your autoload.php, you should also use encryption_key for it.You can give either alphabets or numbers even special characters as keys.

  
config.php


5.  These are the basic libraries and helpers that are to be used before working in Codeigniter. Apart from these two files, there are database.php and routes.php which we will learn in the following tutorials. 
    
 In the next tutorial, we will be developing a simple application. 

Codeigniter--Installation

After MVC Concept, We will be learning about how to install Codeigniter.


1. Download the Codeigniter Framework any version after Using  the stable version 2.2  will be well and good.



2After downloading the file, unzip it and store in local Disk(C:) or in another disk.


3. Save the Codeigniter folder in C:\xampp\htdocs\YourCIfolder.(I prefer using XAMPP if you use WAMP, unzip the file in C:\wamp\www.)



4. Rename the Codeigniter folder as you wish for your project. (eg.Projectigniter)

5Now go to YourCIfolder\application\config and open config.php.


6. In config.php file, you can see $config['base_url'] = '';. Inside the single-quotes write like this. $config['base_url'] = 'http://localhost/YourCIfolder/';.



7. Double-click on the link(http://localhost/projectigniter/) and you will find the screen.




8. That's it! you successfully installed the Codeigniter in your Computer.


    In the next tutorial, we will be learning about configuring the Codeigniter files.