Jump to content

problem with inserting html code in the database


hno

Recommended Posts

HI'

 

I'm using ckeditor_3.2.1 as my html editor . It's good and i only have one problem with inserting html codes in the database  .

 

For example my html code is this  "<span class="a" > hi </span <br /> welcome " , after I have inserting it in the database and retrieve it , it has changed alot and became something like this

 

"<br / > <br /><span class="a" >//////////// hi///////////</span>////////<welcome > <br /> <br /> <br /> <br /> "

 

how can I fix it

 

thanks

Yea I've also got a relatively similar problem.

 

When I enter info into mysql after running it through

function get_post($var)
{
return mysql_real_escape_string($_POST[$var]);
}

 

Things seem to acquire lots of escaping backslashes before apostrophes...etc . Is this normal?

 

They can simply be removed before placing displaying them on screen using str_replace though.

 

http://php.net/manual/en/function.str-replace.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.