Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有没有一种不用JS通过PHP保存Ckeditor数据的方法?_Php_Ckeditor - Fatal编程技术网

有没有一种不用JS通过PHP保存Ckeditor数据的方法?

有没有一种不用JS通过PHP保存Ckeditor数据的方法?,php,ckeditor,Php,Ckeditor,在这里,我创建了一个电子邮件编辑器模板。对于模板创建,我使用CKEditor创建模板。这是我的密码 <?php if (isset($_POST['submit']) ) { //echo $_POST['message']; } ?> 还有这里的脚本 <script> //<![CDATA[ CKEDITOR.replace( 'message'); //]]> </script> 这里是我的HTML代码 <for

在这里,我创建了一个电子邮件编辑器模板。对于模板创建,我使用CKEditor创建模板。这是我的密码

<?php if (isset($_POST['submit']) ) {
    //echo  $_POST['message'];   }   ?>
还有这里的脚本

<script>
//<![CDATA[
  CKEDITOR.replace( 'message');
//]]>
</script>
这里是我的HTML代码

<form method="post" action="">
  <textarea class="for_set_height" id="message" name="message" style="visibility: hidden; display: none;"></textarea>
  <button type="submit" name="submit" value="submit" >
    <i class="icon-book on-left"></i>
    <span>Cancel</span>
  </button>
</form>

是否可以使用php表单提交直接保存Ckeditor数据。

事实上,我不知道为什么它不工作。但我找到了一个方法

这是我的js来保存它

var editor = CKEDITOR.replace('message');  editor.on( 'change', function( evt ) {      $('[name="message"]').val(evt.editor.getData());});

希望它能帮助别人

是的,你可以照常做,但对我来说不行。我想它可能会勾选此链接:-或者您也可以从中获得帮助:-它保存文本区域中的默认值。哪个不在编辑器上