本帖最后由 wangjijun2010 于 2010-08-19 22:47:52 编辑

解决方案 »

  1.   

    oFCKeditor.Value =<?php echo value ?> value 是你要赋的值
      

  2.   


       找不到办法,结果回到根本。 把取得的变量放在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里取得的值,并保存为静态页面,即可完成想要的对静态页面的修改。