Home > Backend Development > PHP Tutorial > Baidu UEditor simple installation, debugging and calling in PHP project, ueditor installation and debugging_PHP tutorial

Baidu UEditor simple installation, debugging and calling in PHP project, ueditor installation and debugging_PHP tutorial

WBOY
Release: 2016-07-13 09:46:31
Original
874 people have browsed it

In the php project, Baidu UEditor is simply installed, debugged and called. Ueditor installation and debugging

For novices, as long as the function 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" 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>
Copy after login

2. Call and pass value

Just add a sentence

to the php file
$sb_remarks=$_POST['sb_remarks'];
Copy after login

================================

Here is my complete example code:

index.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>

Copy after login

sb_add.php

<&#63;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)
&#63;>
Copy after login

3. If you want to modify the default font size of the editor, search for "Font" in the editor UEditor directory and ueditor.all.js file, and you can find the place to modify the font size and font

The above is the entire content of this article, I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1032792.htmlTechArticleBaidu UEditor in the php project is simple to install, debug and call. Ueditor installation and debugging is for novices, as long as the function can be realized. Yes, other settings are completely default. Preview: 1. First of all, get to the official website...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template