如何使用php添加FCKeditor

如何使用php添加FCKeditor,php,Php,我是这个FCKeditor的新手,我使用下面提到的代码,我在文本编辑器中格式化文本,并使用echo语句显示相同的文本,但它只显示纯文本(没有格式化)如何使用格式化语法显示文本。请引导我。提前谢谢 <?php include("fckeditor.php"); $sBasePath = $_SERVER['PHP_SELF'] ; $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_s

我是这个FCKeditor的新手,我使用下面提到的代码,我在文本编辑器中格式化文本,并使用echo语句显示相同的文本,但它只显示纯文本(没有格式化)如何使用格式化语法显示文本。请引导我。提前谢谢

 <?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 &nbsp;:&nbsp;<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;
}
?>

编辑
标题:



[答案更新]

您需要将FCKEditor代码放在
标记中,而不是放在顶部。另外,
$\u POST[“FCKEditor”]
需要放入
$oFCKeditor->Value
变量中

这样做:它在我的机器上工作正常,并在FCKEditor文本区域内显示格式化的HTML:

<html> 
<head>

<title>Editor</title>
</head>
<body>
<form name="frmedit" id = "frmedit" method="post" enctype="multipart/form-data"> 
Title &nbsp;:&nbsp;<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>

编辑
标题:



提示:

非常感谢您的回复,我看到了我正在使用的链接,请按照该链接中给出的说明进行操作。使用$\u POST[“FCKeditor”]语句,我得到了文本。但是如果我想将文本存储在数据库中,我需要语法示例:如果我使用编辑器将文本->Treatme更改为粗体斜体。在echo语句中,它必须像Treatme一样显示。它是Possible@Meena,我已经更新了答案和代码。现在读答案。