Insert tag html into MYSQL using PHP (Codeigniter) -


i want insert tag html (embed youtube mysql) using codeigniter like

<iframe width="560" height="315" src="https://www.youtube.com/embed/7je-ocfmu2y" frameborder="0" allowfullscreen></iframe> 

but in value in table like

&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/7je-ocfmu2y" frameborder="0" allowfullscreen>&lt;/iframe> 

what sholud solve it?

this controller, it's still not work properly

$emb=str_replace('&lt;', '<', $this->input->post('embed')); data = array(       'content' => $this->input->post('judul'),       'embed' => $emb,       'category' => 'video', );             $this->m_admin_tb_website->update_data('video', $data); 

did try using htmlspecialchars_decode function?

try code:

$emb = htmlspecialchars_decode($this->input->post('embed')); 

it works fine me when need same want.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -