Original URL: http://www.111cn.net/wy/CMS/87635.htm
The gbk version of phpcms2008sp4 found that the title, content, etc. were not displayed when editing articles in the background, as shown below:
After investigation It was found that the problem with the htmlspecialchars parameter used by phpcms2008sp4 when processing article information resulted in the loss of Chinese characters (the parameters need to be completed in the php5.4/5.5 version). Directly using htmlspecialchars($data[$field], ENT_QUOTES) returns a null value without any processing.
Solution:
Look in datacache_modelcontent_form.class.php
$value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES) : '';
Change to:
$value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES,'GB2312') : '';
The above introduces the problem of not displaying Chinese characters when modifying the content of phpcms, including the content of GB2312. I hope it will be helpful to friends who are interested in PHP tutorials.