duan5731 2013-06-26 20:29
浏览 31

TinyEditor - 使用$ _POST

Well, I have this code:

<?php 
 if(isset($_POST['texto'])) {
 $texto =  $_POST['texto'];
echo "$texto";

 ?>
 <form action="/env_not.php" method="POST">
<textarea id="tinyeditor" name="texto" style="width: 700px; height: 800px"></textarea>
<script>
var editor = new TINY.editor.edit('editor', {
    id: 'tinyeditor',
    width: 700,
    height: 800,
    cssclass: 'tinyeditor',
    controlclass: 'tinyeditor-control',
    rowclass: 'tinyeditor-header',
    dividerclass: 'tinyeditor-divider',
    controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
        'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
        'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
        'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'],
    footer: true,
    fonts: ['Verdana','Arial','Georgia','Trebuchet MS'],
    xhtml: true,
    cssfile: 'custom.css',
    bodyid: 'editor',
    footerclass: 'tinyeditor-footer',
    toggle: {text: 'source', activetext: 'wysiwyg', cssclass: 'toggle'},
    resize: {cssclass: 'resize'}
});
</script>  <input type='submit' style='text-align: right' name='enviar' value='Enviar'>
  </form>

When I submit this form, my $_POST['texto'] return is blank, how I can pass the value into TinyEditor, to my textarea.texto? Because I need get this value with PHP.

Thanks!

  • 写回答

3条回答 默认 最新

  • duandong9195 2013-08-17 15:55
    关注

    Well, it's been a while but I'll answer with what I found. Maybe it will help someone in the future.

    I had the same problem and then I found that you have to click "source" (to view the html) and then submit. If not, it won't save what you wrote. No idea why this happens, I'm looking for help with this issue myself.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度