Possible Duplicate:
Headers already sent in phpPHPエラー「セッション・キャッシュリミッターを送信することはできません - すでに送信ヘッダ...」
私は次のエラー受け付けております:about.phpに内
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/t/a/t/brians/html/about.php:9) in /home/content/t/a/t/brians/html/includes/sidebar.php on line 2
を私が取得するために、次のコードを持っていますsidebar.phpファイル:sidebar.phpで
<?php include('includes/sidebar.php'); ?>
私は次のコードを持っている:
を<?php
session_start();
$data=array("user1"=>array("url"=>"file1.php","password"=>"pass1"),
"user2"=>array("url"=>"file2.php","password"=>"pass2"));
if(isset($_POST['username']) && isset($_POST['password'])) {
if($data[$_POST['username']]['password'] == $_POST['password']) {
$_SESSION['username'] = $_POST['username'] . " " . $_POST['password'];
header('Location: ' . $data[$_POST['username']]['url']);
} else {
login('The username or password is incorrect. <br />');
}
} else {
login();
}
?>
<?php
function login($response='This is the default message, if there is none provided') {
?>
<img src="../images/clientlogin_header.png" alt="Client Login"></img>
<p>
<div id="login-area">
<form action="" method="post">
<label for="username">username</label>
<input type="text" name="username" />
<label for="password">password</label>
<input type="password" name="password" /><br />
<input type="submit" name="Login" value="Login" class="submit-button" />
</form>
<div style="clear: both;"></div>
</div>
</p>
<?php } ?>
私はこのエラーを正確に解決できません。誰も私に提案を与えることができますか?
そのエラー・メッセージのスタックオーバーフローを検索してください - それは持っています既に5000回以上尋ねられている:) http://stackoverflow.com/search?q=+Cannot+send+session+cache+limiter+-+headers+already+sent –