超级计算机囧囧囧's Archivers

From admin on 2013-01-24 03:52:57

Warning: Cannot modify header information

1. 修改php.ini

找到php.ini

output_buffering = On

output_buffering默认为off的。改成On或者4096

2. 用于header()之前

<?php
ob_start(); //打开缓冲区
echo "hello"; //输出
header("location:index.php"); //把浏览器重定向到index.php
ob_end_flush();//输出全部内容到浏览器
?>

查看完整版本: Warning: Cannot modify header information

Tags:


©超级计算机囧囧囧