2010-03-30 38 views
0

我刚刚下载了FCKeditor并将该文件夹放到我的根目录下,但我不知道如何将FCKeditor安装到我的表单中。例如,我想将FCKeditor整合到下面的表单中的关于我和我的兴趣表单字段中,但我不知道如何甚至是如何更改fckeditor皮肤。我该怎么做呢?PHP和MySQL fckeditor集成?

我正在使用PHP和MySQL。

这里是HTML。

<form method="post" action="index.php"> 
    <fieldset> 
     <ul> 
      <li><label for="about-me">About Me: </label> 
      <textarea rows="8" cols="60" name="about-me" id="about-me"></textarea></li> 

      <li><label for="my-interests">My Interests: </label> 
      <textarea rows="8" cols="60" name="interests" id="interests"></textarea></li> 

      <li><input type="submit" name="submit" value="Save Changes" class="save-button" /> 
     </ul> 
    </fieldset> 
</form> 

回答

0

FCKeditor 2.x, Developers Guide, PHP是集成的FCKeditor到PHP具有很好的指导。您可以包含该文件,创建一个对象,分配一些参数,然后您就可以开始使用了。这很容易和有用。

我希望这会有所帮助。

0

CKEdit只是一个JavaScript插件。为了在PHP和MySQL中使用它,你并不需要采取任何特定的预防措施。你可以按照指导:FCKeditor 2.x, Developers Guide, JavaScript

头:

<script type="text/javascript" src="fckeditor/fckeditor.js"></script> 

身体:

<script type="text/javascript"> 
    var oFCKeditor = new FCKeditor('FCKeditor1'); 
    oFCKeditor.BasePath = "/fckeditor/"; 
    oFCKeditor.Create(); 
</script> 

如果你替换: “FCKeditor1” 在上面的例子中以 “关于我”,并再次感谢您的 “利益” 的领域。

1

比如我做下一个动作:在部分

首先写的代码

<script type="text/javascript" src="ckeditor/ckeditor.js"></script> 

<textarea cols="80" id="FCKeditor1" name="FCKeditor1" rows="10"></textarea> 
<script type="text/javascript"> 
    CKEDITOR.replace('FCKeditor1',{ 
     toolbar : 'Full', 
     skin:'kama' 
    }); 
</script> 

那个动作我在我的浏览器中看到的CKEditor后。

2

如果您使用的是PHP它很容易

<?php 
include_once(“fckeditor/fckeditor.php”) ; 

$sBasePath = $_SERVER[ 'PHP_SELF' ] ;              
$oFCKeditor = new FCKeditor('FCKeditor1') ;             
$oFCKeditor->BasePath = 'fckeditor/' ;              
$oFCKeditor->ToolbarSet = 'Basic';                
$oFCKeditor->Height = 200;                  
$oFCKeditor->Width = 400;                  
$oFCKeditor->Value = '<p>Now the FCKeditor is available and ready to use. So, just insert the  following code in your p</p>' ; 
$oFCKeditor->Create() ; 


?> 

将这个代码在你的HTML。

欲了解更多详情,请参阅我博客中的文章:Basic FCKEditor Integration