【发布时间】:2020-12-18 18:32:46
【问题描述】:
我正在使用 tinyMCE 编辑器在我的应用程序中创建帖子,一旦我格式化文本和文本对齐,创建帖子或更新帖子我需要点击保存。当我点击保存时,tinyMCE 内容应该保存到 mysql 数据库中。我怎么能用 php 做到这一点?
tinymce.init({
entity_encoding : "raw",
selector: '#mytextarea',
plugins: "table print textcolor colorpicker anchor link searchreplace media emoticons lists visualblocks preview wordcount hr contextmenu",
mediaembed_service_url: 'SERVICE_URL',
mediaembed_max_width: 450,
toolbar: "save print forecolor backcolor anchor link searchreplace emoticons visualblocks preview",
});
HTML 代码
<form method="post">
<label name="post-title" for="post-title">Post title</label>
<input type="text" name="post-title" id="post-title"><br>
<label name="post-content" for="post-title">Post Content</label>
<textarea id="mytextarea"></textarea>
<br><br>
<!-- <input type="submit" class="btn btn-beautuful-blue" name="submit" value="CREATE POST"> -->
</form>
【问题讨论】:
-
发布后只需获取它并像简单插入一样插入数据库
-
@billynoah 哎呀我的错误。
-
您要求我们为您编写代码吗?如果没有,您能否更新您的帖子并包含您尝试过的内容?