fckeditor 编辑器的问题,如何给它的输入框赋一个初值 本帖最后由 wangjijun2010 于 2010-08-19 22:47:52 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 oFCKeditor.Value =<?php echo value ?> value 是你要赋的值 找不到办法,结果回到根本。 把取得的变量放在textarea 标签里就行了 以下贴出代码,给我一样新学的朋友看看,这应该是静态页面编辑的最简单一种方法吧。 //页面 newedit.php 通过参数,读取某一静态新闻页面内容 赋值给编辑器的textarea <?php //编辑的新闻内容$newid = $_REQUEST["newid"];//创建 一个连接 $conn = mysql_connect("localhost","root","");mysql_select_db("company",$conn);mysql_query( "SET NAMES UTF8 ");?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><head> <script type="text/javascript" src="../fckeditor/fckeditor.js"></script> <!--载入fckeditor类--><script type="text/javascript"> window.onload = function() { var oFCKeditor = new FCKeditor( 'update' ) ; oFCKeditor.Height = 400; oFCKeditor.BasePath = "../fckeditor/" ; //oFCKeditor.Value = ""; oFCKeditor.ReplaceTextarea() ; }</script><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>用JavaScript调用FCKeditor</title></head><body>修改文章:<?php $mysql_se = "select * from news where newsID='".$newid."'"; $res_se = mysql_query($mysql_se); $row_se = mysql_fetch_row($res_se); // echo $row_se[2]; $handle = fopen($row_se[2],"r"); $rea = fread($handle,filesize($row_se[2])); ?><form action="newedit_inc.php" method="post" name="example"><textarea id ="update" name="updatenew" ><?php echo $rea ?></textarea><input name="ok" type="submit" value="提交"></form></body></html> //页面 newedit_inc.php 接收fckeditor里取得的值,并保存为静态页面,即可完成想要的对静态页面的修改。 PHP 能访问本地(服务器)上其他盘下的文件吗? 希望各位 php 高手帮我下啊 谢谢了 写段代码,要求能够遍历出所有的英文单词 请问ajax post表单,php怎么接收? 求助socket建立临时服务器的问题 PHP程序连接SQL中的一个表其中包含有(时间戳),想导出时把时间戳还原如何做? 如何重置 AUTO_INCREMENT ?(在线等待) 有关unicode的问题 想买空间,给点建议,谢谢!!!! 羊年是本命年,好高兴阿。散分200 PHP,lob文件如何下载? PHP新手求助关于COOKIE的问题!
找不到办法,结果回到根本。 把取得的变量放在textarea 标签里就行了
以下贴出代码,给我一样新学的朋友看看,这应该是静态页面编辑的最简单一种方法吧。
//页面 newedit.php 通过参数,读取某一静态新闻页面内容 赋值给编辑器的textarea <?php //编辑的新闻内容
$newid = $_REQUEST["newid"];
//创建 一个连接
$conn = mysql_connect("localhost","root","");
mysql_select_db("company",$conn);
mysql_query( "SET NAMES UTF8 ");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<script type="text/javascript" src="../fckeditor/fckeditor.js"></script> <!--载入fckeditor类-->
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'update' ) ;
oFCKeditor.Height = 400;
oFCKeditor.BasePath = "../fckeditor/" ;
//oFCKeditor.Value = "";
oFCKeditor.ReplaceTextarea() ;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用JavaScript调用FCKeditor</title>
</head>
<body>
修改文章:
<?php $mysql_se = "select * from news where newsID='".$newid."'";
$res_se = mysql_query($mysql_se);
$row_se = mysql_fetch_row($res_se);
// echo $row_se[2];
$handle = fopen($row_se[2],"r");
$rea = fread($handle,filesize($row_se[2]));
?>
<form action="newedit_inc.php" method="post" name="example">
<textarea id ="update" name="updatenew" ><?php echo $rea ?></textarea>
<input name="ok" type="submit" value="提交">
</form>
</body>
</html>
//页面 newedit_inc.php 接收fckeditor里取得的值,并保存为静态页面,即可完成想要的对静态页面的修改。