FCKEditor的用法与下载

以下是我初次使用FCKEditor的方法,都是来自网上,但网上都不完整,现在我整理下:
1:下载FCKEditor
下载下来后解压到你网站的目录,最好就放在根目录下,文件夹名字就用FCKEditor;这里可以随便自己喜好,但我的例子里就是这样。
2:在页面里引用
首先引用FCKEditor:在你的页面里加入<!-- #include file="FCKeditor/fckeditor.asp" -->
然后在你页面中想要它显示的地方加入以下代码

程序代码
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "98%"
oFCKeditor.Height = "500px"

oFCKeditor.Value = ""
oFCKeditor.Create "logbody"
%>

这段的作用就是初始加载FCKeditor编辑器。这段网上都有注解,可以去搜索。

到此,你就已经添加成功,你的页面中就已经出现编辑器了。

如何把FCKeditor的内容保存到数据库,如何把数据库里的数据显示在FCKeditor中,我想这是多数初用者最想知道的。请看上面引用代码中的这一句:oFCKeditor.Create "logbody" 这里的logbody就代表你的FCKeditor,你也可以用其它的名字。

怎么使用呢,我是这样做的:用一个表单把它装起来,然后就和文本框一样使用了,如:


程序代码
<form action="saveBhou.asp" method="post"> 

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "98%"
oFCKeditor.Height = "500px"

oFCKeditor.Value = ""
oFCKeditor.Create "logbody"
%> 

</form>


然后在saveBhou.asp里读取:text=request("logbody"),这里的text就是你要的内容,把他把存到数据库中就OK。
把数据库里的内容显示在FCKeditor中就在引用代码中给这句赋值oFCKeditor.Value = ""

  

转载于:https://www.cnblogs.com/uuxanet/p/3282804.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值