Witam ostatnio wykonywałem projekt aplikacji biblioteki elektroniecznej, po wgraniu na serwer pojawily sie takie błędy. Zaznacze tylko ze problem wystepuje tylko na serwerze ;x
Pojawiające się błędy:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at index.php:1) in index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at index.php:1) in index.php on line 2
Notice: Undefined index: user in index.php on line 3
Notice: Undefined index: id_user in include/control.php on line 7
Notice: Undefined index: login_user in include/control.php on line 8
Notice: Undefined index: zalogowany in include/control.php on line 13
Warning: Cannot modify header information - headers already sent by (output started at index.php:1) in control.php on line 16
Kod index.php:
<?php
session_start();
if ($_SESSION['user'] == 'admin') header( 'Location: index-admin.php' );
$add_site = true;
include 'include/control.php';
?>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8" />
<title>Aplikacja E-biblioteka</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div id="wrap">
<div class="inner">
<div id="header">
<header>
<div class="header_back">
<a href="">
<img src="images/logo.jpg" class="logo" alt="Logo biblioteki"/>
</a>
</div>
<div class="header_right">
<h3>Aplikacja E-biblioteka</h3><br />
</div>
<div class="clear"></div>
</header>
</div>
<div id="main">
<div class="main_wrap">
<div class="main_left">
<?php include "include/menu-left.php"; ?>
</div>
<div class="clear"></div>
<div class="main_right">
<?php
include "user/my-books.php";
?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
kod control.php
<?php
@session_start();
ini_set( 'display_errors', 'On' );
error_reporting( E_ALL );
$id_user = $_SESSION["id_user"];
$login_user = $_SESSION["login_user"];
@$go = $_GET['go'];
if($go == 'wyloguj') $_SESSION['zalogowany'] = 0;
if (($_SESSION["zalogowany"]) != 1){
unset ($id_user);
unset ($login_user);
header( 'Location: login.php' );
exit;
}
?>
Jest ktoś w stanie mnie nakierować jak rozwiązać ten problem?