解决方案 »
- php邮箱激活功能
- PHP Notice: Use of undefined constant kind - assumed 'kind' in D:\web、
- 求一段PHP程序,使得菜单:当前页是红色按钮,其它是蓝色
- $_SERVER['REQUEST_URI'] getenv("HTTP_REFERER");
- 向各位讨招了,一个中英文风格站的问题.
- yjjqtdht (小齐) 请进来领分!
- PHP+Oracle 分页问题!
- asp中的探针,在php里怎么用?request.servervariables("remote_addr"),request.servervariables("HTTP_REFERER")在php里是什么?
- mail函数的应用
- 求软件
- 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里取得的值,并保存为静态页面,即可完成想要的对静态页面的修改。