我是这个FCKeditor的新手,我正在使用下面提到的代码,我在文本编辑器中格式化文本,并使用echo语句显示相同的文本,但它只显示纯文本(没有格式化)如何显示具有格式化语法的文本。请提前给我指引.thanks
<?php
include("fckeditor.php");
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('FCKeditor') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $ing ;
$oFCKeditor->Create() ;
?>
<html>
<head>
<title>Editor</title>
</head>
<body>
<form name="frmedit" id = "frmedit" method="post" enctype="multipart/form-data">
Title : <input type="text" name="txttitle" id = "txttitle">
<br>
<br>
<input type="submit" name="subsubmit" id="subsubmit" value="SUBMIT">
</form>
</body>
</html>
<?php
if($_POST["subsubmit"]=="SUBMIT"){
$part2 = $_POST["FCKeditor"];
echo $part2;
}
?>发布于 2010-09-06 15:37:28
已更新的答案
您需要将FCKEditor代码放在<form> </form>标记内,而不是放在顶部。此外,还需要将$_POST["FCKEditor"]放在$oFCKeditor->Value变量中。
这样做:它在我的机器上运行良好,并在FCKEditor文本区域中显示格式化的超文本标记语言:
<html>
<head>
<title>Editor</title>
</head>
<body>
<form name="frmedit" id = "frmedit" method="post" enctype="multipart/form-data">
Title : <input type="text" name="txttitle" id = "txttitle">
<?php
include("fckeditor.php");
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('FCKeditor') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $_POST["FCKeditor"] ;
$oFCKeditor->Create() ;
?>
<br>
<br>
<input type="submit" name="subsubmit" id="subsubmit" value="SUBMIT">
</form>
</body>
</html>提示:
https://stackoverflow.com/questions/3649720
复制相似问题