form과 textarea를 이용하는 ckeditor 사용예제이다.

$ cat test.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript" src="./ckeditor/ckeditor.js"></script>
<form action="save.php" method="post">
<textarea name="text1" class="ckeditor">
<?php
include "./test.html"
?>
</textarea>
<input type="submit" value="Submit"/>
</form>
</body>
</html> 

 $ cat save.php
<html>
<head>
<meta http-equiv="refresh" content="0;url=./test.php">
</head>
<?php
        $fp = fopen('./test.html','w');
        echo $fp;
        $ret = fwrite($fp, $_POST['text1']);
        echo $ret;
        fclose($fp);
?>
</html>


[링크 : http://stackoverflow.com/questions/6545521/ckeditor-how-do-i-save-to-the-web-page-i-am-editing]
Posted by 구차니