让tinymce显示我在文本区域内输入的内容



目前我能够将内容发布到数据库并通过SQL查询检索此内容。

不幸的是,当我检索内容时,它在网页上显示为

<p>Shaun this is the record</p> <p>The next line of the r...

我知道这很可能与配置有关,我尝试了几种解决方案,但都失败了。

有人能告诉我我应该在我的配置?

下面是我当前的配置,它只是放在php文件的标签中:

<head>
<script language="javascript" type="text/javascript" src="/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({        
            theme : "advanced",       
            mode : "textareas",
            encoding : "xml"});
</script>
</head>

谢谢你的时间,任何解决方案都会很棒!

$sql = "SELECT * ".
   "FROM podContent ORDER BY id DESC ".
   "LIMIT $offset, $rec_limit ";
$podText = htmlspecialchars_decode($row['imageName']);
$retval = mysql_query( $sql, $con );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
echo "<div class="pods">";
echo "<a href="/page.php?id={$row['id']}">";
echo "<div class="podHeading">";  
echo "{$row['heading']}</a> <br> ";
echo "</div>";
echo "<div class="podImage">";    
echo "<img src="images/{$row['imageName']}">";
echo "</div>";
$string = $podText;
if(strlen($string) > 100) {
echo substr($string, 0, 100).'...'.$hyperlink;}
else {
echo $string;

}

您应该寻找$podText变量和$string变量

您可以使用php函数解码这些字符,如

$variable_to_display = htmlspecialchars_decode($variable_from_database);

试试这个

$sql = "SELECT * ".
   "FROM podContent ORDER BY id DESC ".
   "LIMIT $offset, $rec_limit ";

$retval = mysql_query( $sql, $con );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
echo "<div class="pods">";
echo "<a href="/page.php?id={$row['id']}">";
echo "<div class="podHeading">";  
echo "{$row['heading']}</a> <br> ";
echo "</div>";
echo "<div class="podImage">";    
echo "<img src="images/{$row['imageName']}">";
echo "</div>";
$podText = htmlspecialchars_decode($row['imageName']);
$string = $podText;
if(strlen($string) > 100) {
echo substr($string, 0, 100).'...'.$hyperlink;}
else {
echo $string;

相关内容

  • 没有找到相关文章

最新更新