header, kode-fejl
hejsa...Jeg har et problem med nogle sider på mit websted...
Jeg får følgende fejl:
Warning: Cannot modify header information - headers already sent by (output started at /customers/marzman.dk/marzman.dk/httpd.www/upload/index.php:3) in /customers/marzman.dk/marzman.dk/httpd.www/counter.php on line 46
Siden ligger her: http://marzman.dk/upload
Her er nogle kide koder hvis i kan bruge dem:
------------------------top.php-------------------------
<?php include("counter.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-4" />
<title>||-|| The private website of marZman --|-- Kenneth Mortensen ||-||</title>
<script language="javascript" type="text/javascript">
function PopUp(){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=ScreenWidth-290-movefromedge;
placementy=movefromedge;
var PopUpUrl="http://marzman.dk/player/player-safe.php"
WinPop=window.open(PopUpUrl,"","width=290,height=200,toolbar=0,location=0,directories=0,status=0,scrollbars=0,menubar=0,resizable=0,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
}
</script>
<link rel="stylesheet" href="/style.css" type="text/css" media="all" />
</head>
<body>
<table align="center" border="0" width="800" cellpadding="0" cellspacing="0"><tr><td style="border: 1px #000000 solid;">
<div align="center"><img src="/top.jpg" border="0" width="800" height="75" alt="kenneth.marzman.dk" /></div>
<div style="padding-left: 5px; background-color: #000000; color: #FFFFFF; text-align: center;">
<strong>marZman.dk - Forsøgs hjemmeside lavet i php</strong></div>
<table align="center" style="border: 0px; width: 800px; height: 440px;"><tr>
<td width="150" valign="top" style="background-color:transparent">
<table border="0" width="130">
<tr><td class="menu"><a href="/" class="menu">Home</a></td></tr>
<tr><td class="menu"><a href="/info" class="menu">Profil</a></td></tr>
<tr><td class="menu"><a href="/pc" class="menu">Min PC</a></td></tr>
<tr><td class="menu"><a href="/geek" class="menu">Nørd eller hvad?</a></td></tr>
<tr><td class="menu"><a href="/gaver" class="menu">Ønske seddel</a></td></tr>
<tr><td class="menu"><a href="/guestbook" class="menu">Se gæstebogen</a></td></tr>
<tr><td class="menu"><a href="/guestbook/add.php" class="menu">Skriv i gæstebogen</a></td></tr>
<tr><td height="250" bgcolor="#FFFFFF" valign="top">
<img style="border:0;width:68px;height:22px"
src="/images/hp_logo.gif"
alt="Powered by HP" /></a>
<br />
<a href="http://validator.w3.org/check?uri=referer"><img
src="/images/xhtml.gif"
alt="Valid XHTML 1.0!" border="0" height="31" width="88" /></a>
<br />
<a href="http://jigsaw.w3.org/css-validator/">
<img style="border:0;width:88px;height:31px"
src="/images/css.gif"
alt="Valid CSS!" /></a>
<br />
<a href="java script:PopUp()">
<img style="border:0;width:88px;height:31px"
src="http://marzman.dk/player/grafik/link.jpg"
alt="Hør netradio" /></a>
<br />
Prøv min netradio med alle de kendte kannaler
</td>
</tr></table>
</td>
<td width="475" height="300" valign="top" class="menu">
------------------upload/index.php:-----------------------
<?php
//Define some variables
$dir = "/customers/marzman.dk/marzman.dk/httpd.www/upload/"; //Change this to the correct dir
//MIME types to allow, Gif, jpeg, zip ::Edit this to your liking
$types = array("image/gif","image/pjpeg","application/x-zip-compressed");
//Check to determine if the submit button has been pressed
if(isset($_POST['submit'])){
//Shorten Variables
$tmp_name = $_FILES['upload']['tmp_name'];
$new_name = $_FILES['upload']['name'];
//Check MIME Type
if (in_array($_FILES['upload']['type'], $types)){
//Move file from tmp dir to new location
move_uploaded_file($tmp_name,$dir . $new_name);
echo " was uploaded sucessfully!";
}else{
//Print Error Message
echo "<small>File <strong><em></em></strong> Was Not Uploaded!</small><br />";
//Debug
$name = $_FILES['upload']['name'];
$type = $_FILES['upload']['type'];
$size = $_FILES['upload']['size'];
$tmp = $_FILES['upload']['name'];
echo "Name: $name<br/ >Type: $type<br />Size: $size<br />Tmp: $tmp";
}
}
else{
echo 'Could Not Upload Files';
}
?>
<form action=\"<?php echo $_SERVER['PHP_SELF']; ?>\" method=\"post\" enctype=\"multipart/form-data\">
<fieldset>
<legend>Upload Files</legend>
<input type="file" name="upload" /></fieldset>
<input type="submit" name="submit" value="Upload Files" /></form>
-------------------------bund.php:------------------------
</td>
<td width="150" valign="top">
<?php
include "news.txt";
?>
</td></tr></table>
<table width="800" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="copyright">Copyright © 2001-2004 by Kenneth Mortensen - Siden er optimeret til 1024 x 768</td></tr></table>
</td></tr></table>
</body>
</html>
---------------------newz.txt (include i bund.php)--------------
<table width="150" class="win" cellpadding="0" cellspacing="0">
<tr><td width="150" class="top">05/12/2004</td></tr>
<tr><td width="150" style="padding-left: 5px;">
Nu virker min counter også, altså besøgs tælleren...<br />
Det er også grunden alle de mange fejl i på siden tidligere.
</td></tr></table>
<table width="150" class="win" cellpadding="0" cellspacing="0">
<tr><td width="150" class="top">05/12/2004</td></tr>
<tr><td width="150" style="padding-left: 5px;">
Så ligger min ønske liste online. Med Links til mere info!<br />
Også en side med nogle nørd sætninger er lagt online...
</td></tr></table>
<table width="150" class="win" cellpadding="0" cellspacing="0">
<tr><td width="150" class="top">04/12/2004</td></tr>
<tr><td width="150" style="padding-left: 5px;">
Nu virker min gæstebog perfekt! Der er mulighed for enden at bruge smilies som almindelig tekst, eller som billeder!
</td>
</tr></table>
<table width="150" class="win" cellpadding="0" cellspacing="0">
<tr><td width="150" class="top">29/11/2004</td></tr>
<tr><td width="150" style="padding-left: 5px;">
Sidens design er lavet og lagt online!
</td></tr>
</table>
<br />
<table width="150" class="win" cellpadding="0" cellspacing="0">
<tr><td width="150" class="top">Statistik:</td></tr>
<tr><td width="150" style="padding-left: 5px;">
<strong>Din Ip:</strong>
<?php
$ip = $_SERVER["REMOTE_ADDR"]; // get the ip number of the user
echo "$ip";
?>
<br />
<?php
include'/customers/marzman.dk/marzman.dk/httpd.www/users-online.php';
?>
<br />
<strong>Din opløsning: </strong><script language="Javascript" type="text/javascript">document.write(window.screen.width + " x " + window.screen.height)</script>
<br />
<strong>Browser:</strong> <?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') )
{
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape') )
{
$browser = 'Netscape';
}
else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') )
{
$browser = 'Mozilla Firefox';
}
else
{
$browser = 'Mozilla';
}
}
else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
{
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') )
{
$browser = 'Opera';
}
else
{
$browser = 'Internet Explorer';
}
}
else
{
$browser = 'Ukendt browser';
}
echo $browser;
?>
<br />
<strong>Dato:</strong>
<?php
echo date("d F Y");
?>
<br />
<strong>Tid:</strong>
<?php
echo date("H:i");
?>
<br />
<strong>Hits ialt:</strong> <? include ("/customers/marzman.dk/marzman.dk/httpd.www/counter.txt"); ?>
<br />
<strong>Genererings tid:</strong> <br />
<?php
$time_start = microtime(true);
// Sleep for a while
usleep(100);
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "$time sekunder\n";
?>
</td></tr></table>
Hvordan løser jeg fejlen.
