我其实和很多人一样一直在找一个简单可用用的php在线编辑器,其实没有必要提供很强悍的功能,一般是图片,swf,链接,也就够了。
在研究uch的过程中感觉它的在线编辑器还是不错的,而且调用还是挺间的。
看了一下,我觉得包含这样这份文件,你就可以用这个php在线编辑器了。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //先说如何使用 <form id="postform" name="postform" method="post" action="test.php"> <textarea class="userData" name="message" id="uchome-ttHtmlEditor" style="height:100%;width:100%;display:none;border:0px"></textarea> <iframe src="editor.php?charset=utf-8&allowhtml=1" name="uchome-ifrHtmlEditor" id="uchome-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:100%;border: 1px solid #C5C5C5;" height="200"></iframe> <input type="hidden" name="confirmgo" value="go" /> <input type="submit" name="posteditsubmit_btn" id="posteditsubmit_btn" onclick="edit_save();" value="提交" class="submit" /> </form> <?php if ($_POST['confirmgo']=='go') { $message = $_POST['message']; echo '拿到-->'.$message.'<--'; exit(); } ?> |
简单吧,你很简单的从message这个值拿到用户输入的东西了。
当然,至于一些过滤什么的,请自行考虑。
下面说说包含的文件
1.editor.php
2.source/script_common.js
3.image/editor 这个目录的所有文件
4.请研究一下js文件里的函数,一些无关函数完全可以删掉,进行进一步的精简。总共php+js的大小大约是40k 50k不到。
怎么样,这个php在线编辑器简单吧?
Recent Comments