SivaCoHan 发表于 2012-2-17 00:45:49

求教,我的redirect为什么报错

代码如下,一个controller

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
        class Admin extends CI_Controller{
                function __construct(){
                        parent::__construct();
                        $this->load->database();
                        $this->load->helper('url');
                        $this->load->library('pagination');
                        date_default_timezone_set('Asia/Shanghai');
                }
               
                function index(){
                        redirect('login/');
                }


我直接访问http://www.example.com/ci/admin
报错,信息为。
A PHP Error was encounteredSeverity: WarningMessage: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\ci\application\controllers\admin.php:1)Filename: helpers/url_helper.phpLine Number: 546我想知道,我这些地方哪里有输出呢?

ci_phper_mj 发表于 2012-2-17 10:54:52

错误提示,不能修改头消息-头消息已经被发送了。

Hex 发表于 2012-2-17 12:44:38

D:\AppServ\www\ci\application\controllers\admin.php 文件有 BOM,
什么是BOM请搜索论坛。

vergil 发表于 2012-2-17 13:45:47

BOM真是个讨厌的东西

SivaCoHan 发表于 2012-2-17 14:12:14

修改编码,成功了。谢谢各位
页: [1]
查看完整版本: 求教,我的redirect为什么报错