Yesterday, the site suddenly uploaded photos can not be displayed, and can not be centered, the background is ckeditor. Then went into the meditation, initially thought is the editor of the problem, change the editor test, or the same problem, apparently ruled out the editor's problem. What's the problem?
From the editor's input source analysis, content is quoted and HTML tags, but when submitted ckeditor will such as "<" and other pre-defined words into the HTML entity, the contents after the conversion has been manifested.
By querying the database results, the quotes in the content are replaced and blank, but the resulting data can still be interpreted in the editor, but the style is a mess and some other tags have been added. It is these causes the foreground style is disordered, causes the uploading picture to be unable to display and the center question.
Find out why, and then the idea is solved.
At this point I think of the PHP configuration file if the MAGIC_QUOTES_GPC parameter. Sure enough, this parameter is off. When turned on, data passed through Get,post,cookie is automatically escaped.
if Magic_quotes_gpc=off; In the case of a character with quotation marks (whether single or double quotes), writing directly to MySQL will become blank.
This is obviously the cause of the problem, so turn on this parameter magic_quotes_gpc=on. The data inserted into the database is displayed as normal, and the quotation marks are replaced by \ (backslash).
When fetching data, use $contents = Preg_replace ("/\\\\/", "'", $contents), and replace it with normal display in the editor.
This solves the problem. About the use of the data escaping parameters of the storage after the special composition summary.
Original: http://www.francissoung.com/biancheng/178.html
The above describes the CKEditor editor upload image can not be centered and the problem of style confusion, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.