Dom
Dom

Reputation: 7

CKEditor is putting \ on my page each time I save something with apostrophe

I am using ckeditor on my website and I have a seperate box at the top which displays the chapter name.

<input type="text" id="chapter" name="chapter" value="'.$chapter_title.'"/>

Each time I save the CKeditor page when I have an apostrophie it puts a \ in the chapter name.

eg.  John's   becomes   John\'s  
Then each time I save it adds more \ 
so second time John's becomes John\\'s then third time John\\\'s etc.

Does anyone know how to stop this please?

Upvotes: 0

Views: 117

Answers (4)

heyanshukla
heyanshukla

Reputation: 669

Use php function stripslashes() before echoing the content.

Upvotes: 0

CodeCaster
CodeCaster

Reputation: 151586

Disable magic quotes.

Upvotes: 1

Deniss Kozlovs
Deniss Kozlovs

Reputation: 4841

Perhaps your magic_quotes_gpc is turned on?

Upvotes: 1

user783322
user783322

Reputation: 481

Read about the functions addslashes() and stripslashes().

Upvotes: 0

Related Questions