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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.