Home >Backend Development >PHP Tutorial >Baidu UEditor is simple to install, debug and call. Other tutorials on the Internet are too official and not suitable for novices. UEditor installation and debugging_PHP tutorial
For novices, as long as the functions can be realized, Other settings are completely default.
Preview:
1. First go to the official website to download, not much to say. After downloading, unzip it to the directory you want on the website. I put it in the root directory. Where you need to use the editor, insert the following HTML code:
<!-- 加载编辑器的容器 --> <!-- 以下脚本中增加文本为初始化内容 --> <script id="container" name="sb_remarks" type="text/plain">$sb_remarks=$_POST['sb_remarks'];
================================
Here is my complete example code:
index.html:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>设备档案</title> </head> <body> <form method="post" action="s.php" name="search" /> <input name="search" type="text" value="" size="15" /> <input type="submit" value="Search" /> </form> <br/> <hr/> 添加设备 <div> <form action="sb_add.php" method="post"> 设备名称:<input type="text" name="sb_name" /><br/> 编码型号:<input type="text" name="sb_numandtype" /><br/> 生产厂家:<input type="text" name="sb_home" /><br/> 启用日期:<input type="text" name="sb_usedate" /><br/> 安装位置:<input type="text" name="sb_address" /><br/> <!--更新日期:<input type="text" name="sb_updatetime" /><br/>--> <!-- <input type="text" name="sb_remarks" /> --> <!-- 加载编辑器的容器 --> <!-- 以下脚本中增加文本为初始化内容 --> <script id="container" name="sb_remarks" type="text/plain"><?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. If you want to modify the default font size of the editor, search for "Font" in the editor UEditor directory, ueditor.all.js file, and you can find the place to modify the font size and font