简体   繁体   English

jQuery / PHP-所见即所得编辑器,用于保存$ _POST数据

[英]jQuery/PHP - WYSIWYG Editor To Save $_POST Data

I found a WYSIWYG editor called Redactor Redactor Home Page . 我找到了一个名为Redactor Redactor主页的WYSIWYG编辑器。 So I'd like to implement this so I can take it and actually save the data. 因此,我想实现这一点,以便可以接受并实际保存数据。 Does anyone have any experience that can tell me how I can get the POST data they say there is? 有没有人有任何经验可以告诉我如何获得他们说的POST数据? They really do not describe it in any detail for me at least POST "Tutorial" Here And then go down to UploadFields and there is where they attempt to describe how to get the POST data. 他们真的没有为我详细描述它,至少在POST“ Tutorial”这里然后转到UploadFields,在那里他们尝试描述如何获取POST数据。

I have a client that would LOVE to have this on his site, any tips or suggestions would be greatly appreciated, Necro. 我有一个客户希望将其保存在他的网站上,任何提示或建议将不胜感激,Necro。

As part of the setup, this requires you to have a textarea in the page. 作为设置的一部分,这要求您在页面中有一个textarea Make sure that element has a name attribute, and when your form is submitted, that'll go to the server. 确保该元素具有名称属性,并在提交表单时将其发送到服务器。

<form method="POST" action="/save_text.php">
    <textarea id="redactor_content" name="content"></textarea>
    <input type="submit" value="Save" />
</form>

<script type="text/javascript">
$(document).ready(
    function() {
        $('#redactor_content').redactor();
    }
);
</script>

In save_text.php, your text will be in $_POST['content'] . 在save_text.php中,您的文本将在$_POST['content']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM