所见即所得编辑器有问题


Having Issue with WYSIWYG editor

嗨,我在保存编辑的页面时遇到问题。

所见即所得的编辑器称为 CkEditor。

这是我的管理员

<?php
session_start();
header("Cache-control: private");
require_once ('../include/back.php');
include_once("../ckeditor/ckeditor.php");?>
<html>
<head>
<title>ADMIN</title>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
</head>
<body>
<br>
<form action="../article.php" method="post" target="_blank">
<?php
$CKEditor->basePath = '/ckeditor/';
$CKEditor = new CKEditor();
$CKEditor->editor("editor1", $initialValue);
$initialValue = '<p>Words</p>';
?>
<input type="submit" value="Submit"/>
</form>
</body>
</html> 

这是我的文章页面的第二页:

<?php
session_start();
header("Cache-control: private");
include("include/back.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
</head>
<body>
<div align="center">
<table>
<tr>
<td>
<?php
$editor_data = $_POST[ 'editor1' ];
echo $editor_data;
?>
</td>
</tr>
</table>
</body>
</html>

我无法从 CKeditor 保存我的文章页面文件 (html)。当我输入内容并发布它时,CKeditor 会起作用,但当我单击指向同一页面的菜单链接时,它是空白的。

任何建议或解释将不胜感激。任何示例也会有所帮助。T

您的文章页面是否仅使用以下代码来显示您输入到编辑器的内容?

<?php
    $editor_data = $_POST[ 'editor1' ];
    echo $editor_data;
?>

$_POST变量填充每个请求。它不是为了存储超过 1 个请求的数据。您必须获取此数据并以更持久的形式保存它,例如写入数据库或文件。使用此代码,您可以查看已输入到编辑器的内容,但仅在发送时查看。生成页面并将其发送到浏览器后,文本将丢失。任何其他用户都不会仅仅因为他没有发送此数据而看到这一点。当您返回页面时,您也不会看到它。