zoukankan      html  css  js  c++  java
  • ckeditor的图片上传

    开始

    下载ckeditor,ckfinder,将这两个文件放在更目录下边的include文件夹下面

    在使用ckeditor的html

     ckfinder.php的修改

    63行:

    $baseUrl改为:

                 $phpSelf = $_SERVER["PHP_SELF"];
                 $basePath = substr($phpSelf, 0, strpos($phpSelf, 'cekditor')).'/application/news/';//我的存储路径
                 $baseUrl =$basePath;

     

    85行:

    $baseUrl:

    $baseUrl原来的删除:

    改为:

    $baseDir = substr($_SERVER['SCRIPT_FILENAME'], 0,strpos($_SERVER['SCRIPT_FILENAME'], 'ckeditor')).'/application/news/' ;//项目路径

     function CheckAuthentication(){

      return true;//建议加一个判断,原来是return false

    }

    <script type='type/javascript'  src='include/ckeditor/ckeditor.js'> </script>

    <script type='type/javascript'  src='include/ckfinder/ckfinder.js'> </script>

    <script type='type/javascript'>

    N_Text=CKEDITOR.replace('N_Text',{
             toolbar : 'Basic',
             uiColor : '#9AB8F3',
             filebrowserBrowseUrl        : '<!--{$approot}-->ckeditor/ckfinder/ckfinder.html',//<!--{$approot}-->的路径是从php页面许可过来的,从项目路径出发
             filebrowserImageBrowseUrl   : '<!--{$approot}-->ckeditor/ckfinder/ckfinder.html?Type=Images',
             filebrowserFlashBrowseUrl   : '<!--{$approot}-->ckeditor/ckfinder/ckfinder.html?Type=Flash',
             filebrowserUploadUrl        : '<!--{$approot}-->ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
             filebrowserImageUploadUrl   : '<!--{$approot}-->ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
             filebrowserFlashUploadUrl   : '<!--{$approot}-->ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });

    </script>

    加粗部分的路径必须正确,否则上传不显示。

  • 相关阅读:
    统计一行字符串中每个字母个数
    不定宽高的文字在div中垂直居中
    转:Python 与 Excel 不得不说的事
    Centos 6安装python3.5
    day04
    day03
    Day02
    python ciscolib模块
    三级菜单
    模拟登陆系统
  • 原文地址:https://www.cnblogs.com/zhangjun516/p/2825060.html
Copyright © 2011-2022 走看看