header sendt før output
Jeg for fejlen.Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/amwebdk/public_html/Portal/WWW_Kogebogen/NyHTML/index.php:1) in /home/amwebdk/public_html/Portal/WWW_Kogebogen/NyHTML/index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/amwebdk/public_html/Portal/WWW_Kogebogen/NyHTML/index.php:1) in /home/amwebdk/public_html/Portal/WWW_Kogebogen/NyHTML/index.php on line 2
Normalt for jeg den fordi jeg har et mellemrum før <?php der hvor jeg har mine sektioner og cookies, men sådan ser det ikke ud til at være denne gang, så hvad kan det være.
Koden ses her:
_______________________________________
<?php
session_start();
/*********************************************************
| |
| Hvis personen har logget ind manuelt |
| |
*********************************************************/
if ($_POST['tjek'] == "login")
{
include "/rod/opret-forbindelse.php"; //opretter forbindelse
$anti_sql_infiktion_input = $_POST['brugernavn'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$username = $anti_sql_infiktion_output;
$anti_sql_infiktion_input = $_POST['password'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$pass_hash = $anti_sql_infiktion_output;
$password = hash('sha256', $pass_hash);
$brugersql = "SELECT * FROM `kogebogen-bruger` WHERE brugernavn='".$username."' AND kodeord='".$password."' AND aktiv='aktiveret'";
$bugervissql = mysql_query($brugersql) OR DIE();
$findesbruger = mysql_num_rows($bugervissql);
if ($findesbruger == "1")
{
$login = "ja";
$_SESSION['brugernavn'] = "$username";
$_SESSION['password'] = "$password";
if ($_POST['huskmig'] == "on" && $login == "ja")
{
setcookie("login[brugernavn]", "$username", time()+(60*60*24*30));
setcookie("login[password]", "$password", time()+(60*60*24*30));
}
}
else
{
$login = "nej";
$fejl = "Brugernavnet og/eller kodeordet er forkeret";
$username = "";
$password = "";
}
}
/*********************************************************
| |
| Hvis personen har logget ind uden cookies |
| |
*********************************************************/
elseif (isset($_SESSION['brugernavn']) && isset($_SESSION['password']) && $_POST['tjek'] != "login")
{
include "/rod/opret-forbindelse.php"; //opretter forbindelse
$anti_sql_infiktion_input = $_SESSION['brugernavn'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$username = $anti_sql_infiktion_output;
$anti_sql_infiktion_input = $_SESSION['password'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$password = $anti_sql_infiktion_output;
$brugersql = "SELECT * FROM `kogebogen-bruger` WHERE brugernavn='".$username."' AND kodeord='".$password."' AND aktiv='aktiveret'";
$bugervissql = mysql_query($brugersql) OR DIE();
$findesbruger = mysql_num_rows($bugervissql);
if ($findesbruger == "1")
{
$login = "ja";
}
else
{
$login = "nej";
$fejl = "Fejl: ændring i session";
$username = "";
$password = "";
}
}
/*********************************************************
| |
| Hvis personen logges ind via cookies |
| |
*********************************************************/
elseif (isset($_COOKIE['login']['brugernavn']) && isset($_COOKIE['login']['password']) && !isset($_POST['tjek']) && !isset($_SESSION['brugernavn']) && !isset($_SESSION['password']))
{
include "/rod/opret-forbindelse.php"; //opretter forbindelse
$anti_sql_infiktion_input = $_COOKIE['login']['brugernavn'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$username = $anti_sql_infiktion_output;
$anti_sql_infiktion_input = $_COOKIE['login']['password'];
include "/home/amwebdk/public_html/Portal/WWW_Kogebogen/MySQL/Anti-SQL-infiktion/A-SQL-i.php"; //Anti-SQL-infiktion
$password = $anti_sql_infiktion_output;
$brugersql = "SELECT * FROM `kogebogen-bruger` WHERE brugernavn='".$username."' AND kodeord='".$password."' AND aktiv='aktiveret'";
$bugervissql = mysql_query($brugersql) OR DIE();
$findesbruger = mysql_num_rows($bugervissql);
if ($findesbruger == "1")
{
$login = "ja";
$_SESSION['brugernavn'] = "$username";
$_SESSION['password'] = "$password";
}
else
{
$login = "nej";
$fejl = "Fejl: ændring i cookies";
$username = "";
$password = "";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Net Kogeren | En god gratis kogebog for alle</title>
<!-- ====================Metadata==================== -->
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="da">
<!-- ===================Beskrivelse================== -->
<meta name="Title" content="Net Kogeren | En god gratis kogebog for alle">
<meta name="Keywords" content="Net Kogeren, Kogebog, Bropatisk venlig, Opskrifter">
<meta name="Description" content="En god gratis kogebog for alle">
<!-- ======================CSS======================= -->
<link rel="stylesheet" href="CSS/screen.css" type="text/css" media="screen">
<link rel="stylesheet" href="CSS/print.css" type="text/css" media="print">
<link rel="stylesheet" href="CSS/main.css" type="text/css">
<!-- ==================JavaScript==================== -->
<!--[if lt IE 7]>
<script defer type="text/javascript" src="JS/pngfix.js"></script>
<![endif]-->
<script type="text/javascript">
//Google Analytics
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
//Google Analytics
try {
var pageTracker = _gat._getTracker("UA-7539611-1");
pageTracker._trackPageview();
}
catch(err) {}
</script>
<script type="text/javascript">
//preloader billeder
var preload = new Array(4);
for(var i = 0; i < 4; i++)
{
preload[i] = new Image();
}
preload[0].src = "img/menu_on.png";
preload[1].src = "img/2.png";
preload[2].src = "img/3.png";
preload[3].src = "img/4.png";
</script>
<script defer type="text/javascript" src="JS/drobdown.js"></script>
</head>
<body onload="safari();">
<div id="main">
<div class="menu">
<div class="quikmenu">
<a href="java script:window.print()">Udskriv</a> | <a href="#">Bogmærk</a>
</div>
<div class="overskirft">
<span class="menuoverskrift">Net Kogeren</span>
<span><br></span>
<span class="menuunderskrift">En god gratis kogebog for alle</span>
</div>
<!--[if IE]>
<div class="mainmenuIE">
<![endif]-->
<div class="mainmenu">
<ul id="menu">
<li><a id="1" onmouseover="forsideon();" onmouseout="forsideout();" style="height: 29px;" href="/">Forside</a></li>
<li><a id="2" onmouseover="soegon();" onmouseout="soegout();" style="height: 29px;" href="index.php?soeg=opskrift">Søg</a></li>
<li><a id="3" onmouseover="opretbrugeron();" onmouseout="opretbrugerout();" style="height: 29px;" href="index.php?profil=opret">Opret bruger</a></li>
<li><a id="4" onmouseover="omsidenon();" onmouseout="omsidenout();" style="height: 29px;" href="index.php?info=omsiden">Om siden</a></li>
<li><a id="5" onmouseover="profilon();" onmouseout="profilout();" style="height: 29px;" href="index.php?Opret=skriv">Profil</a></li>
<li><a id="6" onmouseover="faqon();" onmouseout="faqout();" style="height: 29px;" href="index.php?info=faq">FAQ</a></li>
<li><a id="7" onmouseover="adminon();" onmouseout="adminout();" style="height: 29px;" href="index.php?admin=mysql">Admin</a></li>
</ul>
</div>
<!--[if IE]>
</div>
<![endif]-->
</div>
<div class="center">
<div class="print"><hr></div>
<div class="tekst">
<?php
if (isset($_GET['bio']))
{
if ($_GET['bio'] == "bio")
{
$import = "Sider/bio.php";
}
}
else
{
$import = "Sider/forside.php";
}
require_once($import);
?>
</div>
<div class="sideboks">
<div class="sideboks_top">
<span class="sideboks_top_overskrift">Login</span>
</div>
<div class="sideboks_center">
<div class="sideboks_center_boks">
Bla. bla. Bla. bla. B
</div>
</div>
<div class="sideboks_bottom">
</div>
<div class="sideboks_top">
<span class="sideboks_top_overskrift">Login</span>
</div>
<div class="sideboks_center">
<div class="sideboks_center_boks">
Bla. bla. Bla. bla. Bl
</div>
</div>
<div class="sideboks_bottom">
</div>
</div>
<div style="height:0;overflow:hidden;clear:both"> </div>
</div>
<div class="bund">
lavet af: Andreas Madsen | Version <a href="index.php?version=netkogeren">1.04</a> ©
</div>
</div>
<!--[if IE]>
<div class="drobdownIE">
<![endif]-->
<div id="drobdown">
<div id="forside" style="display: none; left:124px;">
</div>
<div id="soeg" style="display: none; left:252px;">
<ul class="drobdown_submenu" onmouseover="soegon();" onmouseout="soegout();">
<li><a href="index.php?soeg=opskrift" style="display: block;"><span class="drobdown_tekst">Søg i opskrifter</span></a></li>
<li><a href="index.php?soeg=bruger" style="display: block;"><span class="drobdown_tekst">Søg i bruger</span></a></li>
</ul>
</div>
<div id="opretbruger" style="display: none; left:380px;" onmouseover="opretbrugeron();" onmouseout="opretbrugerout();">
</div>
<div id="omsiden" style="display: none; left:508px;" onmouseover="omsidenon();" onmouseout="omsidenout();">
<ul class="drobdown_submenu">
<li><a href="index.php?info=omsiden" style="display: block;"><span class="drobdown_tekst">Om siden</span></a></li>
<li><a href="index.php?info=kontakt" style="display: block;"><span class="drobdown_tekst">Kontakt</span></a></li>
</ul>
</div>
<div id="profil" style="display: none; left:636px;">
<ul class="drobdown_submenu" onmouseover="profilon();" onmouseout="profilout();">
<li><a href="index.php?Opret=skriv" style="display: block;"><span class="drobdown_tekst">Indsend opskirft</span></a></li>
<li><a href="index.php?rediger=skriv" style="display: block;"><span class="drobdown_tekst">Rediger opskrift</span></a></li>
<li><a href="index.php?profil=se" style="display: block;"><span class="drobdown_tekst">Se profil</span></a></li>
</ul>
</div>
<div id="faq" style="display: none; left:764px;">
</div>
<div id="admin" style="display: none; left:892px;">
<ul class="drobdown_submenu" onmouseover="adminon();" onmouseout="adminout();">
<li><a href="index.php?rediger=skriv" style="display: block;"><span class="drobdown_tekst">Rediger opskrift</span></a></li>
<li><a onclick="return confirm('Er du sikker på at du vil slette denne opskrift!\nsom er indsendt af (PHP navn) den (PHP dato)');" href="index.php?slet=id" style="display: block;"><span class="drobdown_tekst">Slet opskrift</span></a></li>
<li><a href="index.php?admin=mysql" style="display: block;"><span class="drobdown_tekst">MySQL stasik</span></a></li>
<li><a href="index.php?admin=links" style="display: block;"><span class="drobdown_tekst">Admin links</span></a></li>
</ul>
</div>
</div>
<!--[if IE]>
</div>
<![endif]-->
</body>
</html>
___________________
Reultatet ses her: http://www.kogebogen.a-mweb.dk/NyHTML/