[英]Getting tinymce to display what I type withing the textarea?
目前,我可以将内容发布到数据库并通过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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.