Welcome Guest, Not a member yet? Register   Sign In
posting code tag in form
#1

(This post was last modified: 06-19-2020, 09:24 AM by jreklund.)

hello , i started to get on my old code ingiter website recently and i forgot alot of things Wink ,  i need a bit of help for posting code like iframe

because when i try to post things like <iframe src="https://www.facebook.com/plugins/video.php? allowFullScreen="true"></iframe>

the < get changed to &lt;

and i cant seem to find  where to look if someone could point me in the right direction Smile

i have to modify directly in database actualy to get it to work


this is my controller :
PHP Code:
public function news_new()
  {
      $this->form_validation->set_error_delimiters('<div class="alert alert-error">''</div>');
      if ($this->form_validation->run('news')===FALSE)
      {
      $this->news();
      }
      else
      {
      $this->model_admin->add_news();
      $this->news();
      }
  


my model :
PHP Code:
public function add_news()
{
  $data=array (
    
'titre_news'=>$this->input->post('titre_news'),
    
'introduction'=>$this->input->post('introduction'),
    
'contenu_news'=>$this->input->post('contenu_news'),
    
'tete_pont'=>$this->input->post('tete_pont'),
    
'photo_news'=>$this->input->post('photo_news'),
    );
  $this->db->insert('news'$data);
  $id_emi=$this->db->insert_id();    
  $categorie 
$this->input->post('id_categorie');
  foreach ($categorie as $cat)
  {
      $data =array(
   
'id_categorie' => $cat,
   
'id_news' => $id_emi );
   
$this->db->insert('multi_cat_news'$data); 
  }  



and form validation

Code:
'news' => array(
    array(
        'field' => 'titre_news',
        'label' => 'titre_news',
        'rules' => 'required'
   ),
   array(
        'field' => 'id_categorie',
        'label' => 'id_categorie',
        'rules' => 'required'
   ),
   array(
        'field' => 'introduction',
        'label' => 'introduction',
        'rules' => 'required'
   ),
     array(
        'field' => 'photo_news',
        'label' => 'photo_news',
        'rules' => 'required'
   ),
   array(
        'field' => 'contenu_news',
        'label' => 'contenu_news',
        'rules' => 'required'
   )
   ),

thx for helping out
Reply
#2

Check to see if you have the global XSS filter on.
Reply
#3

oh my forgot about that , yes indeed global xss filter was on
thx a lot Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB