Witajcie, mam taki problem.
Gdy wpiszę w przeglądarce adres np domena.pl/admin.php to tego błędu nie ma, a gdy zaincluduje plik to pojawia sie error:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\WWW\index.php:10) in C:\WWW\admin.php on line 3
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\WWW\index.php:10) in C:\WWW\admin.php on line 3PLik:
<?php
//header("Cache-Control: max-age=0");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Panel administracyjny</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css" media="all">
<?php if($_GET['s'] == 'zdjecia') { ?>
</style>
</head>
<body>
<?php
if($_GET['s'] == 'wyloguj') {
header("HTTP/1.1 301 Moved Permanently"); }
if($_SESSION['logowanie'] != 'zapraszamy') {
?>
<br />
<div id="logowanie">Logowanie</div>
<?php
if($_POST['submit']) {
function checkPass($user, $pass){
$users = array("root" => "root" );
if($users[$user] == $pass){
return true;
}
else{
return false;
}
}
else{
return false;
}
}
if(!isSet($_POST["haslo"]) || !isSet($_POST["user"])){ ?>
<div class="formularz_logowania">
<div style="text-align: center;"><b>Błędna nazwa użytkownika lub hasło!</b></div>
</div>
<?php
}
else if(checkPass($_POST["user"], $_POST["haslo"])){
$_SESSION['logowanie'] = "zapraszamy";
header("HTTP/1.1 301 Moved Permanently"); }
else{
?>
<div class="formularz_logowania">
<div style="text-align: center;"><b>Błędna nazwa użytkownika lub hasło!</b></div>
</div>
<?php
}
}
?>
<form name="logowanie" action="admin.php" method="post">
<div class="formularz_logowania">
<label for="user">Login: </label>
<input type="text" size="35" id="user" name="user" />
</div>
<div class="formularz_logowania">
<label for="haslo">Hasło: </label>
<input type="password" name="haslo" size="35" id="haslo" />
</div>
<div class="formularz_logowania">
<input class="zaloguj" type="submit" name="submit" value="Zaloguj się do panelu!" />
</div>
</form>
<?php }
if($_SESSION['logowanie'] == 'zapraszamy') {
include("config.php"); //config baza
?>
<div id="calosc">
<div id="dane">
<?php
if($_GET['s'] == 'edycja') include("edytuj_podstrone.php");
?>
</div>
<br />
</div>
<?php
} ?>
</body>
</html>