fejl på linje 68
Hejsajeg har et nyheds system men for denne fejl
Warning: Cannot modify header information - headers already sent by (output started at /web/www/frac/users/codemanager/login/nyheder.php:23) in /web/www/frac/users/codemanager/login/nyheder.php on line 68
Her er siden
<?php
include('side_funktioner.php');
$start_time = getmicrotime();
//Vi starter sessions
session_start();
//Hvis ikke sessions er sat, bliver man sendt til adgang_forbudt.php
if(!isset($_SESSION['s_brugernavn'], $_SESSION['s_admin'])) {
header("Location:adgang_forbudt.php");
exit;
}
?>
<HTML>
<HEAD>
<TITLE>Velkommen til CodeManager</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<div align="center"><BODY BGCOLOR=#FFFFFF leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#666699"><br><br>
<table width=780 border=0 cellpadding=0 cellspacing=0 height="383" bgcolor="#FFFFFF">
<tr>
<td rowspan=2> <img src="../images/index_01.gif" width=165 height=35></td>
<td colspan=2> <img src="../images/index_02.gif" width=615 height=24></td>
</tr>
<tr>
<td> <img src="../images/index_03.gif" width=1 height=11></td>
<td rowspan=2> <img src="../images/index_04.gif" width=614 height=73></td>
</tr>
<tr>
<td colspan=2 height="39"> <img src="../images/logo.gif" width=166 height=62></td>
</tr>
<tr>
<td colspan=3 background="../images/links.gif">
<?
include ("../menu.php");
?>
</td>
</tr>
<tr>
<td colspan=3 height="233">
<table width="100%" border="0" cellspacing="0" cellpadding="10" height="188">
<tr>
<td height="212"><font color="#999999" face="Geneva, Arial, Helvetica, san-serif" size="2"><b>
<?
//Tilslutter til db
include ('mysql_funktioner.php');
aabn_forbindelse_og_vaelgdb();
if($_POST['upload']){
if ($_POST['pic'] == 1) {
$files = $_FILES['upfil']['name'];
$dist = $_SERVER["DOCUMENT_ROOT"] . "/codemanager/login/nyheder/billeder/";
move_uploaded_file($_FILES['upfil']['tmp_name'], $dist . $files);
}
elseif ($_POST['pic'] == 2) {
$files = "opdatering.gif";
} else {
$files = "nopic.gif";
}
$today = date("H:i d-m-Y");
$sti = "billeder/".$files;
mysql_query("INSERT INTO news (title, dato, text, name, file) values ('$_POST[title]', '$today', '$_POST[text]', '$_POST[name]', '$sti')") or die (mysql_error());
$_SESSION['besked']='<b>Nyheden er tilføjet</b>';
header("Location:../index.php");
}
?>
Her kan du tilføje nye nyheder...<br><br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
Forfatter:<br>
<input type="text" name="name" size="30"><br>
Overskrift:<br>
<input type="text" name="title" size="30"><br>
Billede:<br>
<input type="radio" value="1" checked name="pic"> <input type="file" name="upfil" size="20"> <br>
<input type="radio" value="2" checked name="pic"> opdatering på siden<br>
<input type="radio" value="3" checked name="pic"> intet billede<br>
<textarea rows="6" name="text" cols="26">nyhed</textarea><br>
<input type="submit" value="tryk nyhed" name="upload">
</form>
<?php
Echo"Her kan du slette gamle nyheder<br><br>";
// Slet en bruger, hvis der er blevet bedt om det
if(isset($_GET['slet']) && !empty($_GET['slet'])){
mysql_query('delete from news WHERE id = \''.$_GET['slet'].'\'') or die (mysql_error());
echo "<font color='#FF0000'>nyheden er slette.</font><br><br>";
}
// Hent først data ud
$resultat = mysql_query('select id, title, dato from news');
// Kør så igennem for hver række
while ($raekke = mysql_fetch_array($resultat)) {
extract($raekke);
echo 'Nyhed: <a href="'.$_SERVER['PHP_SELF'].'?slet='.rawurlencode($id).'">'.$title." ".$dato.' [Slet]</A><br><br>';
}
include ("menu.php");
?>
<br>
</font></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=3 height="14">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="25" align="center">
<tr>
<td background="../images/index_08.gif" height="25">
<div align="center"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="#666699">
Copyright© 2003 CodeManager</font></b></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</BODY></div>
<?
$end_time = getmicrotime();
echo "<br><br>Genereringstid: " . round($end_time - $start_time, 4);
?>
</HTML>
og her er linje 68
header("Location:../index.php");