Hi all
I really like the look of ckEditor. But it is clear to me that I have not understook how it should work.
My objective is to build a web site that I can maintain by creating text an an "Admin" area using maintenance programs which will give Word-like Bold, lists, tables etc and store these entries in a MySQL database. Then to extract this data from the database and present it on my "front of house" web site.
To achieve this I have set up my visible front-of-house web site and populated it with text boxes that will be populated with the contents of the database rows/columns.
In order to populate those table rows/columns I an using ckEditor in my Admin area with bog standard create/change scripts that offer html textareas supported by ckEditor.
But clearly once I have changed my wording in the textbox I need to save it back to the database. However the content of the page breaks the SQL statement with its symbols. In particular, acute, grave etc accents.
But this puzzles me because when I look at the source generated by ckEditor it looks fine to me. For example A acute, a grave are properly translated in the source to á and à. and so can be safely included in an MySQL statement. Immediately after the save it is properly displayed.
But then, once the script is left and another script is run, when I come back it is shown as á instead of as an "a" with an acute sign above it. Plus it shows paragraph, span, bold starts and ends and all of the other HTML as well instead of formatting it.
What do I not understand? What on earth am I doing wrong.
By the way my database is UTF8 and the relevant columns are all utf8_spanish_ci. Before each save I do a mysql_query("SET NAMES 'utf8'") ; instruction in my PHP.
I hope that somebody can help.
I really like the look of ckEditor. But it is clear to me that I have not understook how it should work.
My objective is to build a web site that I can maintain by creating text an an "Admin" area using maintenance programs which will give Word-like Bold, lists, tables etc and store these entries in a MySQL database. Then to extract this data from the database and present it on my "front of house" web site.
To achieve this I have set up my visible front-of-house web site and populated it with text boxes that will be populated with the contents of the database rows/columns.
In order to populate those table rows/columns I an using ckEditor in my Admin area with bog standard create/change scripts that offer html textareas supported by ckEditor.
But clearly once I have changed my wording in the textbox I need to save it back to the database. However the content of the page breaks the SQL statement with its symbols. In particular, acute, grave etc accents.
But this puzzles me because when I look at the source generated by ckEditor it looks fine to me. For example A acute, a grave are properly translated in the source to á and à. and so can be safely included in an MySQL statement. Immediately after the save it is properly displayed.
But then, once the script is left and another script is run, when I come back it is shown as á instead of as an "a" with an acute sign above it. Plus it shows paragraph, span, bold starts and ends and all of the other HTML as well instead of formatting it.
What do I not understand? What on earth am I doing wrong.
By the way my database is UTF8 and the relevant columns are all utf8_spanish_ci. Before each save I do a mysql_query("SET NAMES 'utf8'") ; instruction in my PHP.
I hope that somebody can help.
Re: I have a fundamental mis-understsnding ... help please
You can verify this by looking in the DB to see if the HTML and looking at the HTML source code in the web page. I guess it looks like this :
Original String : 'école secondaire'
DB String '&eacte;cole secondaire'
Web page String 'école'
If it looks like this, it means that that the HTML is escaped twice.
I don't know PHP, but I guess there's a parameter in the outputing function that indicate if it's esacaping HTML.
Re: I have a fundamental mis-understsnding ... help please