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

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

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

StringGrid issue in Delphi XE8 firemonkey mobile app -