php项目中百度 UEditor 简单安装调试和调用,ueditor安装调试
对于新手来说,只要能实现功能即可,其它设置完全默认。
预览图:
1.首先 到官网下载,这个不多说。下载后解压到网站你想要的目录,我这里放到根目录下在你需要使用编辑器的地方,插入如下HTML代码:
<!-- 加载编辑器的容器 --> <!-- 以下脚本中增加文本为初始化内容 --> <script id="container" name="sb_remarks" type="text/plain" style="width:600px;height:200px;"> <p> <strong><span style="font-size: 14px;">备注:</span></strong> </p> <p> <br/> </p> </script> <!-- 配置文件 --> <script type="text/javascript" src="./ueditor/ueditor.config.js"></script> <!-- 编辑器源码文件 --> <script type="text/javascript" src="./ueditor/ueditor.all.js"></script> <!-- 实例化编辑器 --> <script type="text/javascript"> var ue = UE.getEditor('container'); </script>
2.调用传值
只需在php文件中,加入一句
$sb_remarks=$_POST['sb_remarks'];
================================
下面是我的完整事例代码:
index.html:
设备档案
添加设备
sb_add.php
<?php $con = mysql_connect("localhost","root","110"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_query("set names 'utf8'",$con); mysql_select_db("bzec", $con); $sb_name=$_POST['sb_name']; $sb_numandtype=$_POST['sb_numandtype']; $sb_home=$_POST['sb_home']; $sb_usedate=$_POST['sb_usedate']; $sb_address=$_POST['sb_address']; //$sb_updatetime=$_POST['sb_updatetime']; $sb_updatetime=date("Y-m-d G:i:s"); $sb_remarks=$_POST['sb_remarks']; //$nikename= trim($nikename); /* if (!$nikename || !$email) //判断是否为空 { echo '不能为空'; exit; } */ $sql="INSERT INTO shebeidangan (sb_name,sb_numandtype,sb_home,sb_usedate,sb_address,sb_updatetime,sb_remarks) VALUES ('$sb_name','$sb_numandtype','$sb_home','$sb_usedate','$sb_address','$sb_updatetime','$sb_remarks')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "ADD OK"; mysql_close($con) ?>
3.如果要修改 编辑器默认字体大小的话,在编辑器UEditor目录,ueditor.all.js文件里面查找“字体” ,就可以找到修改字号和字体的地方
以上所述就是本文的全部内容了,希望大家能够喜欢。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment