level 1
生夏花丶逝秋菊
楼主

入口文件:<?php
define('APP_DEBUG',TRUE);
define('APP_NAME', 'Hello');
define('APP_PATH', './');
require '../ThinkPHP/ThinkPHP.php';
?>
---------IndexAction.Class.php----------
<?php
class IndexAction extends Action {
public function index(){
header("Content-Type:text/html; charset=utf-8");
echo '<div style="font-weight:normal;color:blue;float:left;width:345px;text-align:center;border:1px solid silver;background:#E8EFFF;padding:8px;font-size:14px;font-family:Tahoma">^_^ Hello,欢迎使用!<span style="font-weight:bold;color:red">ThinkPHP</span></div>';
}
}
-----config.php-------
<?php
return array( 'DB_DSN' => 'mysql://root:x1x1@localhost:3306/thinkphp'
);
?>
--------------------
以上文件均是用UTF8格式保存,为何还会出乱码?数据库编码虽然还没有设置,但以上输出并不涉及数据库吧?