leider bekommen ich mit der header-methode diese fehlermeldung gibt es alternativen? und woran liegt der fehler?
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\freie_zimmer\phpplanner\settobook.php:14) in C:\Program Files\xampp\htdocs\freie_zimmer\phpplanner\settobook.php on line 16
<?php
session_start();
if(!isset($_SESSION['tempdays']))
{
$_SESSION['tempdays'] = Array();
}
if($_SESSION['checktempdays'] != $_GET['stamp'])
{
$_SESSION['tempdays'][] = $_GET['stamp'];
$_SESSION['checktempdays'] = $_GET['stamp'];
}
foreach($_SESSION['tempdays'] as $tempday)
{
echo $tempday.'<br>';
}
header("Location index.php?".session_name()."=".session_id()."");
exit;
?>
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\freie_zimmer\phpplanner\settobook.php:14) in C:\Program Files\xampp\htdocs\freie_zimmer\phpplanner\settobook.php on line 16
<?php
session_start();
if(!isset($_SESSION['tempdays']))
{
$_SESSION['tempdays'] = Array();
}
if($_SESSION['checktempdays'] != $_GET['stamp'])
{
$_SESSION['tempdays'][] = $_GET['stamp'];
$_SESSION['checktempdays'] = $_GET['stamp'];
}
foreach($_SESSION['tempdays'] as $tempday)
{
echo $tempday.'<br>';
}
header("Location index.php?".session_name()."=".session_id()."");
exit;
?>
Kommentar