fck editor issue with single quote

August 23, 2013 at 03:52:18
Specs: Windows XP

I am using fck editor in php code and facing issue while entering single quote like ' v '.
Also I am not able to use character like '\0'. If I use this it omits single quotes and also character '0'

See More: fck editor issue with single quote

Report •


#1
August 23, 2013 at 15:03:19
If you decide to move from a WYSIWYG editor, I suggest Notepad++:
http://notepad-plus-plus.org/

You won't have such quotation/apostrophe and PHP command errors with it.

Have you tried their support forum?
http://ckeditor.com/forums

--------------------------------------------------
Apologies if I don't respond to your reply immediately. I don't check this site daily, but you're welcome to PM me as a reminder.

message edited by Xps86


Report •

#2
August 23, 2013 at 23:19:32
Thank you so much For Rpl..But My problem is when i insert ' (single quotes) in database through fckeditor,it wont allow it.. This is My code.

"insert into $user
(id,question,option1,option2,option3,option4,correctAnswer,category,section,chapter)
VALUES
("
. ",$newstd," .
"','". htmlspecialchars($_POST['FCKeditor0'],ENT_QUOTES) .
"','" . htmlspecialchars($_POST['FCKeditor1'],ENT_QUOTES) .
"','" . htmlspecialchars($_POST['FCKeditor2'],ENT_QUOTES) .
"','" . htmlspecialchars($_POST['FCKeditor3'],ENT_QUOTES) .
"','" . htmlspecialchars($_POST['FCKeditor4'],ENT_QUOTES) .
"','" . htmlspecialchars($_REQUEST['correctans'],ENT_QUOTES) .
"'," . htmlspecialchars($_REQUEST['MyRadio'],ENT_QUOTES) .
"'," . htmlspecialchars($_REQUEST['section'],ENT_QUOTES) .
"'," . htmlspecialchars($_REQUEST['chapter'],ENT_QUOTES) .
")";


Query Not running

message edited by punam123


Report •

#3
August 28, 2013 at 22:30:37
It would help to see the whole page's syntax. I can see off the top that you're opening the database values with double quotes, then closing it almost immediately to add ,$newstd,
Those periods you're adding are getting in the way. Since it's all PHP anyway, you don't need to close the PHP line then reopen it for the next statement. Keep it open.
htmlspecialchars($_POST['FCKeditor0'],ENT_QUOTES),htmlspecialchars($_POST['FCKeditor1'],ENT_QUOTES)

You may be better off setting the input to variables, amending them with htmlspecialchars, then inserting the variables as SQL values like:
VAULES("$FCKeditor0,$FCKeditor1,$FCKeditor2");

You may also be better off using POST for all those columns, depending on how the application is supposed to work.

Additionally, if your table only contains those 10 columns and you're inserting them in the exact order that the columns sit in the database, you don't need to specify the column names.

--------------------------------------------------
Apologies if I don't respond to your reply immediately. I don't check this site daily, but you're welcome to PM me as a reminder.

message edited by Xps86


Report •
Related Solutions


Ask Question