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.



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



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



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.