• tp上传图片(编辑器)


    <?php
    class AiXinAction extends Action{
        
        //上传爱心协议
        public function shangchuan()
        {
            if(empty($_POST))
            {
                $this->display();
            }
            else
            {
                $model = M("fanwe_xieyi");
                $model->create();
                $re = $model->add();
                if($re)
                {
                    echo "添加成功";
                }
                else
                {
                    echo "添加失败";    
                }
            }
    
        }
        
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--注意顺序-->
    <script type="text/javascript" charset="utf-8" src="http://localhost/tp/editor/utf8-php/ueditor.config.js"></script><!--绝对路径-->
    <script type="text/javascript" charset="utf-8" src="http://localhost/tp/editor/utf8-php/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="http://localhost/tp/editor/utf8-php/lang/zh-cn/zh-cn.js"></script>
    <title>无标题文档</title>
    
        <style type="text/css">
            div{
                width:100%;
               }
        </style>
    </head>
    
    <body>
    
    <h3 align="center">共献爱心协议</h2>
    <form action="__URL__/shangchuan" method="post" >
    <input type="hidden" value="" name="id" />
    名 字:<input type="text"  name="name"  style=" 80%; border:medium; outline:none"  /><hr />
    协 议:<textarea name="picture" rows="1" cols="200px" id="fp" style="background:transparent; border:none; outline:none"></textarea><hr />
    时 间:<input type="text" name="time"  style="border:0px; outline:none" /><hr />
    <input type="submit" value="上传" />
    </form>
    
    <div align="center">
        <script id="editor" type="text/plain" style=" 100%;height:400px;"></script>
    </div><br />
    
    <div align="center"> <button onclick="getContent()">存入图片</button></div>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <script type="text/javascript">
     
        var ue = UE.getEditor('editor');
        
        function getContent() {
            var str = UE.getEditor('editor').getContent();
            document.getElementById("fp").textContent = str ;
        }
    </script>
    
    
    
    <div></div>
    </body>
    </html>
  • 相关阅读:
    Spring MVC入门——day01
    Spring5学习笔记——day05
    [BJDCTF2020]The mystery of ip
    [网鼎杯 2020 青龙组]AreUSerialz
    [网鼎杯 2018]Fakebook
    文件上传绕过学习
    [极客大挑战 2019]PHP
    无参数RCE总结及文件读取学习
    java中多线程执行时,为何调用的是start()方法而不是run()方法
    minconda安装配置
  • 原文地址:https://www.cnblogs.com/erinzhismile/p/5826571.html
Copyright © 2020-2023  润新知