以下是PHP程序<?php
require_once("conn_inc.php");
require_once("smarty_inc.php");
if ($_REQUEST['id']) {
$id=$_REQUEST['id'];
$query=mysql_query("select * from new where id='$id' ");
$row=@mysql_fetch_array($query);
$content=$row['content'];
}
$smarty->assign("content",$content);
$smarty->display("new_update.tpl.html");
?>以下是模板程序<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<form action="" method="POST">
<table border="1" align="center" width="70%">
<tr>
<td>内容:</td>
<td>
{literal}
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.BasePath = "fckeditor/" ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = "{$content}" ;
oFCKeditor.Create() ;
</script>
{/literal}
</td>
</tr>
<tr>
<td colspan="2"><center><input name="submit" value="更新提交" type="submit"></center></td>
</tr>
</table>
</form>
当我通过
$smarty->assign("content",$content);
把值传送给模板变量{$content}的时候在模板页面中不显示
当我查看原程序的时候发现
oFCKeditor.Value = "{$content}" ; 中对以的有值,大家看下我哪里写错了!
require_once("conn_inc.php");
require_once("smarty_inc.php");
if ($_REQUEST['id']) {
$id=$_REQUEST['id'];
$query=mysql_query("select * from new where id='$id' ");
$row=@mysql_fetch_array($query);
$content=$row['content'];
}
$smarty->assign("content",$content);
$smarty->display("new_update.tpl.html");
?>以下是模板程序<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<form action="" method="POST">
<table border="1" align="center" width="70%">
<tr>
<td>内容:</td>
<td>
{literal}
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.BasePath = "fckeditor/" ;
oFCKeditor.Height = 300 ;
oFCKeditor.Value = "{$content}" ;
oFCKeditor.Create() ;
</script>
{/literal}
</td>
</tr>
<tr>
<td colspan="2"><center><input name="submit" value="更新提交" type="submit"></center></td>
</tr>
</table>
</form>
当我通过
$smarty->assign("content",$content);
把值传送给模板变量{$content}的时候在模板页面中不显示
当我查看原程序的时候发现
oFCKeditor.Value = "{$content}" ; 中对以的有值,大家看下我哪里写错了!
解决方案 »
- 是从远程API专业服务器拿数据快呢,还是从本地服务器拿数据快呢
- PHP怎么查找出字符串中所有的Email地址
- PHP入门书《PHP和MySQL Web开发》是第三版好呢还是第四版好
- php+mysql在双线服务器如何进行优化?大侠救命啊
- PHP获取路径问题
- 虚拟主机上的图片目录有好几万个图片,怎么下载比较快?
- 请问url_rewriter.tags里的 form=fakeentry 是什么意思?作什么用的?
- 简单问题,怎么不能得到get方式的值?
- 用ewebeditor插入图片,提交后不正常显示
- 文件上传!
- 为什么Topmargin属性在Firefox中无法显示?
- 如何 用php获取本季度的第一天 本月的第一天,本周的第一天,谢谢,最好给出详细代码
{/literal}
用了这个标签,不支持变成输出!
问题应该就出现在{literal}
{$content}就不被编译了。看看这样如何:<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<form action="" method="POST">
<table border="1" align="center" width="70%">
<tr>
<td>内容:</td>
<td>
{literal}
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'content' ) ;
oFCKeditor.BasePath = "fckeditor/" ;
oFCKeditor.Height = 300 ;
{/literal}
oFCKeditor.Value = "{$content}" ;
{literal}
oFCKeditor.Create() ;
</script>
{/literal}
</td>
</tr>
<tr>
<td colspan="2"><center><input name="submit" value="更新提交" type="submit"></center></td>
</tr>
</table>
</form>