Rakesh Shetty
Rakesh Shetty

Reputation: 4578

TinyMCE not storing data in db properly

Im using TinyMCE but the problem is when im storing the TinyMCE data to db at my localhost it works properly but when im using same TinyMCE and storing into db on server it is not storing properly.I want to store data:-

The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. 

but in db it stores like(server) :-

The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.

it appends "\" before ""(double codes) when im running my code on server(Linux)

Thanks in advance

Upvotes: 2

Views: 1510

Answers (3)

jay
jay

Reputation: 916

It's Magic Quotes. phpinfo() on the page will tell you if they are active, and if they are, turn it off in your php.ini file.

Make sure these are all set to Off:

magic_quotes_gpc = Off
magic_quotes_runtime = Off 
magic_quotes_sybase = Off

Upvotes: 4

Ingro
Ingro

Reputation: 2841

You could try this:

$_REQUEST['text'] = stripslashes($_REQUEST['text']);

This will strip off the "\", I think they are there cause of the PHP directive magic_quotes_gpc.

Upvotes: 2

Ikke
Ikke

Reputation: 101231

I don't think that has to do with TinyMCE, but with your server.

There is an PHP option called Magic Quotes that automatically adds slashes before quotes.

phpinfo() would show if magic quotes are turned on.

Upvotes: 2

Related Questions