我现在在用PHP做一个简单的论坛,用到了FCKEDITOR,我先用它代替我文本输入框,就是发帖的那部分。
<form method="post" action="add_topic.php" id="postComment">
<table>
  <tr>
<td>话题</td>
<td><input name="topic" type="text" id="topic" size="50"><td>
  </tr>
  <tr>
    <td>正文</td>
    <td><textarea name="detail" cols="50" rows="10" id="detail"></textarea></td>
  </tr>
</table>代替正文那部分.....用replacetextarea方法代替
但是搞了好久就是没有弄明白....看了好多教程了...悟性太低了  include ("fckeditor/fckeditor.php");
  $oFCKeditor = new FCKeditor('detail') ;
  $oFCKeditor->BasePath = './FCKeditor/';
  $oFCKeditor->Value = '';
如果有知道的,就说清楚一点把,悟性实在不高啊......fckeditorPHP

解决方案 »

  1.   

    你没有用 $oFCKedit->Create();创建窗口
    TEXTAREA标记替换法(不建议使用):在页面的ONLOAD事件中,添加以下代码以替换一个已经存在的TEXTAREA标记(其Name、ID须与FCKeditor实例名相同)< html>
    < head>
    < script type="text/javascript">
    window.onload = function()
    {
    var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
    oFCKeditor.ReplaceTextarea() ;
    }
    < /script>
    < /head>
    < body>
    < textarea id="MyTextarea" name="MyTextarea">This is < b>the< /b> initial value.< /textarea>
    < /body>
    < /html>
      

  2.   


    <?php
      /***********************************/
      /*      文件名:create_topic.php   */
      /*      功能:发表文章页面  */
      /***********************************/  require('config.inc.php');
      include('header.inc.php'); 
    ?><h2>创建新贴</h2><?php 
      if (!$_SESSION['username'])
      { 
      //如果用户未登录,显示错误信息
    ?><h3>未注册的用户</h3>
    <p>对不起,请<a href="create_user.php">注册</a>新用户,
    或者进行<a href="logon_form.php">登录</a>。
    </p><?php
      }else{ 
    //如果用户登录,显示输入表单
    ?><h3>发言注意事项</h3>
    <ul>
    <li>所有项目必须填写。</li>
    <li>在标题和正文中不能使用HTML代码。</li>
    <li>为了安全起见,请不要在论坛中透录密码等重要信息。</li>
    </ul><form method="post" action="add_topic.php" id="postComment">
    <table>
      <tr>
    <td>话题</td>
    <td><input name="topic" type="text" id="topic" size="50"><td>
      </tr>
      <tr>
        <td>正文</td>
        <td><textarea name="detail" cols="50" rows="10" id="detail"></textarea></td>
      </tr>
    </table><?php
      //如果是管理员,将显示“置顶”和“锁定”功能
      if ($_SESSION['username'] == ADMIN_USER)
      {
    ?>
    <br>将帖子置顶 <input type="checkbox" name="sticky" value="on">
    <br>锁定该帖子 <input type="checkbox" name="locked" value="on">
    <?php
      }
    ?><br><br>
    <input type="submit" name="Submit" value="立即发布" class="button">
    <input type="reset" name="Submit2" class="button">
    </form><?php } ?><?php 
    //公用尾部页面
    include('footer.inc.php'); 
    ?>
    这个是我发帖的代码....怎么加进去...