|
$name = $this->input->post("name",TRUE);
$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($name).")";
以上是我的在控制器和MODEL里的两条语句,我单独摘出来;我现在有两个问题:
1、是不是有了 $name = $this->input->post("name",TRUE); 的TRUE ,就不需要再用$this->security->xss_clean();而且也不需要在config里设置$config['global_xss_filtering'] = TRUE; 请问是,还是不是?
2、因为有了这个TRUE , 是不是我的SQL 也不需要写成 $sql = "INSERT INTO table (title) VALUES(".$this->db->escape($name).")"; ,而写成 $sql = "INSERT INTO table (title) VALUES('{$name}')";,请问是,还是不是?
|
|