首页 > 百度编辑器引入网站初始化文件导致无法上传图片

百度编辑器引入网站初始化文件导致无法上传图片

在ueditor/php/controller.php中定义图片上传目录之后
如果引入初始化文件却无法上传文件,提示服务器返回错误

附网站初始化文件

<?php
header("content-type:text/html;charset=utf-8");

// 定义错误级别
define("DEBUG",true);
if(defined("DEBUG") && DEBUG){
    error_reporting(11);
}else{
    error_reporting(0);
}

// 获取网站根目录
define("ROOT_PATH",str_replace(array('\\','init.php'),array('/',''),__FILE__));

// 获取网站域名
define("URL","http://".$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'],'/',ROOT_PATH));

// 防止非法访问
if(!defined("IN_WEB360")){
    header("Location:".URL."index.php?c=error");
    exit;
}

// 自动加载
function  __autoload($class){
    if(stripos($class,"Model")!==false){
        require_once ROOT_PATH."models/{$class}.php";
    }else if(stripos($class,'Controller')!==false){
        if(isset($_GET['s']) && $_GET['s']=="admin"){
            require_once ROOT_PATH."controllers/admin/{$class}.php";
        }else{
            require_once ROOT_PATH."controllers/{$class}.php";
        }
    }else{
        require_once ROOT_PATH."lib/{$class}.class.php";
    }
}

求解!谢谢诸位


可以通过Chrome查看Ueditor的Ajax请求结果,如果是代码错误一般会返回错误码“500”,而且会有错误信息。

【热门文章】
【热门文章】