Hi I am having issue saving the edited page.
The WYSIWYG editor is called CkEditor.
This is my Admin
<?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>
Here is the second page which is my article page:
<?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>
I can’t save my article page file (html) from CKeditor. The CKeditor works when I type something and published it but when I click on the menu link to the same page and it’s blank.
Any suggestion or explanation would be appreciated. Any examples will also helpful too. T
Does your article page uses only the following code to display what you have entered to the editor?
$_POSTvariable is populated with every request. It is not meant to store data for more than 1 request. You must take this data and save it in more persistent form like writing to database or to a file. With this code you can see what you have entered to the editor but only when you send it. The text will be lost once the page is generated and sent to your browser. Any other user won’t see that simply because he didn’t send this data. You also won’t see it when you return to the page.