0
我有問題的標題重定向。當我嘗試重定向,它說這...標題重定向錯誤與網站的頭部分
警告:session_start()[function.session-start]:無法發送會話緩存限制器 - 頭已發送(輸出開始在.../head.php: 7)在...上線/ 3的init.php
head.php如下:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>grand exchange</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="activate.css" rel="stylesheet" type="text/css" />
</head>
的init.php如下:
<?php
ob_start();
session_start();
//error_reporting(0);
require 'core/database/connect.php';
require 'core/functions/general.php';
require 'core/functions/users.php';
if(logged_in() === true){ //bans users
$session_user_id = $_SESSION['id'];
$user_data = user_data($session_user_id, 'id','username', 'password','first_name', 'last_name', 'email', 'areacode');
if(user_active($user_data['username']) === false) {
session_destroy();
header('Location: index.php');
exit();
}
}
$errors = array();
ob_flush();
?>
我加入ob_start和ob_flush到init.php因爲我見過很多o與此相同的問題也解決了。你們對我有一個想法嗎?
非常感謝!
好的,試着在調用/ head的頁面上放一個ob_start? – RightLeftRight12 2013-05-06 21:56:02
@ user2127663可以工作 – 2013-05-06 21:56:53
啊哇它確實工作!感謝我的朋友的幫助! – RightLeftRight12 2013-05-06 21:57:28