PHP输出FCKEditor编辑框的内容
最近在做一个CMS网站程序,编辑文章时需要用到fckeditor,我下载了fckeditor2.6.3,所有的配置都配置好了,我做了个测试,写了两个文件:test_1.p...
最近在做一个CMS网站程序,编辑文章时需要用到fckeditor,我下载了fckeditor 2.6.3,所有的配置都配置好了,我做了个测试,写了两个文件:
test_1.php
<?php
include(dirname(__FILE__)."/fckeditor/fckeditor.php");
$BasePath = "/fckeditor/";
echo "<form action='test_2.php' method='post'>";
$oFCKeditor = new FCKeditor('editor');
$oFCKeditor->BasePath = $BasePath;
$oFCKeditor->Value ='';
$oFCKeditor->Width = '100%';
$oFCKeditor->Height= '300';
$oFCKeditor->Config['SkinPath'] = '/fckeditor/editor/skins/office2003/';
$oFCKeditor->Create();
echo "<input type='submit' /></form>"
?>
test_2.php:
<?php
header('Content-Type: text/html;charset=utf-8');
$content=$_POST['editor'];
echo stripslashes($content);
?>
我在编辑框里输入 FCKEditor Test并设置其格式,格式源码为:
<h3 style="color: red"><span style="background-color: #ffff00"><span style="font-size: xx-large"><span style="font-family: Comic Sans MS">FCKEditor Test</span></span></span></h3>
但是输出后:字体格式都还是设定之前的样子,为什么??
我查看了一下源码:
<h3 style=\"color: red\"><span style=\"background-color: #ffff00\"><span style=\"font-size: xx-large\"><span style=\"font-family: Comic Sans MS\">FCKEditor Test</span></span></span></h3>
发现所有样式属性值style="coor:red"变成了style=\"color:red\",被\隔开了,导致显示不正常,请各位高手帮帮忙,到底是我fackeditor配置不对还是faceditor有bug??? 展开
test_1.php
<?php
include(dirname(__FILE__)."/fckeditor/fckeditor.php");
$BasePath = "/fckeditor/";
echo "<form action='test_2.php' method='post'>";
$oFCKeditor = new FCKeditor('editor');
$oFCKeditor->BasePath = $BasePath;
$oFCKeditor->Value ='';
$oFCKeditor->Width = '100%';
$oFCKeditor->Height= '300';
$oFCKeditor->Config['SkinPath'] = '/fckeditor/editor/skins/office2003/';
$oFCKeditor->Create();
echo "<input type='submit' /></form>"
?>
test_2.php:
<?php
header('Content-Type: text/html;charset=utf-8');
$content=$_POST['editor'];
echo stripslashes($content);
?>
我在编辑框里输入 FCKEditor Test并设置其格式,格式源码为:
<h3 style="color: red"><span style="background-color: #ffff00"><span style="font-size: xx-large"><span style="font-family: Comic Sans MS">FCKEditor Test</span></span></span></h3>
但是输出后:字体格式都还是设定之前的样子,为什么??
我查看了一下源码:
<h3 style=\"color: red\"><span style=\"background-color: #ffff00\"><span style=\"font-size: xx-large\"><span style=\"font-family: Comic Sans MS\">FCKEditor Test</span></span></span></h3>
发现所有样式属性值style="coor:red"变成了style=\"color:red\",被\隔开了,导致显示不正常,请各位高手帮帮忙,到底是我fackeditor配置不对还是faceditor有bug??? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询