+ -
当前位置:首页 → 问答吧 → 初学ThinkPHP 访问时出现非法操作index.html页面

初学ThinkPHP 访问时出现非法操作index.html页面

时间:2011-11-10

来源:互联网

config.php配置信息
<?php
return array(

'APP_DEBUG' => false, // 开启调试模式

'DB_TYPE'=> 'mysql',      // 数据库类型

'DB_HOST'=> 'localhost', // 数据库服务器地址

'DB_NAME'=>'bbwz',  // 数据库名称

'DB_USER'=>'root', // 数据库用户名

'DB_PWD'=>'', // 数据库密码

'DB_PORT'=>'3306', // 数据库端口

'DB_PREFIX'=>'think_', // 数据表前缀
/* URL设置 */
    'URL_CASE_INSENSITIVE' => false,
    'URL_ROUTER_ON'=> false,  
    'URL_DISPATCH_ON'=> true,  
    'URL_MODEL'=> 1,
    'URL_PATHINFO_MODEL' => 2,  
    'URL_PATHINFO_DEPR'=> '/',
    'URL_HTML_SUFFIX'=> '',
);
?>


IndexAction.class.php

<?php
class IndexAction extends Action
{
    function _initialize(){
        header("Content-Type:text/html; charset=utf-8");
    }

    public function index(){
        $this->display();
    }

    public function test(){
        $this->display();

    }
}
?>

访问本地路径
http://localhost:8080/bbwz/admin.php/Index/index.html

模板文件夹下有index.html这个模板文件 ThinkPHP是 2.1版本的

求高手赐教是什么问题...谢过先~~~

作者: debmzhang   发布时间: 2011-11-10

Conf/config.php加上:
  1. TMPL_TEMPLATE_SUFFIX='.html'
复制代码

作者: deeka   发布时间: 2011-11-10