-
-
Save arunoda/040017831024bd0c75cf to your computer and use it in GitHub Desktop.
Codeigniter - XSS Prevention
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Xss extends CI_Controller { | |
public function index() { | |
$this->load->helper("form"); | |
echo form_open("xss/show", array("method" => "POST")); | |
echo form_textarea(array("name" => "code")); | |
echo "<br>"; | |
echo form_submit(array("value" => "Please Submit")); | |
echo form_close(); | |
} | |
public function show() { | |
$this->load->library("input"); | |
$code = $this->input->post("code"); | |
echo $code; | |
//echo $this->security->xss_clean($code); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment