Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Codeigniter] Problem z htmlm w bazie.
motyl-pl
post
Post #1





Grupa: Zarejestrowani
Postów: 294
Pomógł: 31
Dołączył: 2.04.2010

Ostrzeżenie: (0%)
-----


Witam,
Mam formularz który dodaje htmla do bazy.
Zrzut:
  1. if($this->input->post()) {
  2. $this->form_validation->set_rules('tytul', 'tytuł', 'required|min_length[3]|max_length[256]|xss_clean');
  3. $this->form_validation->set_rules('embed', 'embed', 'required|min_length[10]');
  4. $this->form_validation->set_rules('cap', 'kod', 'required|min_length[3]|numeric|matches[nawias]');
  5.  
  6. if ($this->form_validation->run() == TRUE)
  7. {
  8. $dane = array('tytul' => $this->input->post('tytul'),
  9. 'video' => $this->input->post('embed'),
  10. 'video_int' => 1,
  11. 'kategoria' => $this->input->post('kategoria'),
  12. 'ip_dodajacy' => $this->ip,
  13. 'data_dodajacy' => $this->data,
  14. 'zaakceptowane' => 0);
  15. $this->MUpload->add($dane);
  16.  
  17. header('Location: '.base_url('upload/ok.html').'');
  18. }
  19. else
  20. {
  21. $data['content'] = $this->load->view('upload/video', '', true);
  22. $this->load->view('index', $data);
  23. }
  24. } else {
  25. $data['content'] = $this->load->view('upload/video', '', true);
  26. $this->load->view('index', $data);
  27. }


Konkretnie chodzi mi o to że dane porabne z pola "embed" automatycznie mi czyści, a potem gdy pobieram z bazy nie chce wyświetlić jako html tylko np:
<iframe width="560" height="315" src="http://www.youtube.com/embed/ieLKVrsDrNY" frameborder="0" allowfullscreen></iframe>

Ktoś ma może jakiś pomysł ?

Ten post edytował motyl-pl 11.11.2012, 02:22:47
Go to the top of the page
+Quote Post
szok
post
Post #2





Grupa: Zarejestrowani
Postów: 165
Pomógł: 20
Dołączył: 2.03.2006

Ostrzeżenie: (0%)
-----


Zobacz w application/config/config.php
Czy niemasz czasem włączonego:
  1. $config['global_xss_filtering'] = FALSE;

Musi być na false,
Go to the top of the page
+Quote Post
motyl-pl
post
Post #3





Grupa: Zarejestrowani
Postów: 294
Pomógł: 31
Dołączył: 2.04.2010

Ostrzeżenie: (0%)
-----


No proszę dzięki ;D
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 11:19