Modify header information i Php
det virker fint når man er inde på selve scriptet..Men når jeg includer filen her skriver den
ALtså når man prøver på at tilmelde sig ved at klikke på kan eller kan ikke skriver den |
\/
###
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/web/web52230/Site/tilmeld.php:26) in /usr/home/web/web52230/Site/tilmeld.php on line 100
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/web/web52230/Site/tilmeld.php:26) in /usr/home/web/web52230/Site/tilmeld.php on line 109
##
<?php
include('ipmakecookie.php');
session_start();
include("sider.php");
if ($_SESSION['status'] == "login")
{
}
else
{
print(" <script language='javascript'>
location.href='login.php';
</script>");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Ringler.DK - Home og Heroes</title>
</head>
<div class=LeftNavText><font face="Tahoma, Verdana, Comic Sans MS, Arial Black" size="2"><b><u>Menu</u></b></font></div>
<div class=NewsText><p><font face="Tahoma, Verdana, Comic Sans MS, Arial Black" size="2"><b><u>Afstemninger</u></b></font></div>
<div class=MainText><font face="Tahoma, Verdana, Comic Sans MS, Arial Black" size="2"><b><u>Indhold</u></b></font></div>
<div class=LeftNav><?php
if(isset($_COOKIE['admin1'])) {
include('AdminMenu.php');
}
Else{
include('MenigMenu.php');
}
?></div>
<div class=News><font face="Tahoma, Verdana, Comic Sans MS, Arial Black" size="2"><b><?php include('admin/news.txt'); ?></b></font>
</div>
<div class=Main><?php include ('raid.php') ?></div>
<div class=MainBottum>
</div>
<div class=ShoutBoxText><font ><b><u>ShoutBox</u></b></font></div>
<div class=ShoutBox><font face="Tahoma, Verdana, Comic Sans MS, Arial Black" size="+1"><b><?php include('counter/countersolution.php'); ?></b></font></div>
<div class=Banner><img src="BannerHomeOfHeroes.gif" border="1px solid black"></div>
<body>
</body>
</html>
#####
raid.php ser sådan her ud.. (selve scriptet)
<?php
function abe() {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
echo '<html>';
echo '<head>';
echo ' <title>PlazMs Site</title>';
echo ' <meta http-equiv="Content-Language" content="da">';
echo ' <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >';
echo '</head>';
echo '<body>';
}
$query=$_SERVER['QUERY_STRING'];
$query = explode("&", $query);
if($query[0] == "admin"){
abe();
if($query[1] == "ny" && (($_POST['abe1'] && $_POST['text']) || $_POST['abe2'])){
if($_POST['abe1'] && $_POST['text']){
$filename = "current.txt";
$fp = fopen($filename, "w");
$string = $_POST['text'];
$write = fputs($fp, $string);
fclose($fp);
$filename = "abe1.txt";
$fp = fopen($filename, "w");
$string = 0;
$write = fputs($fp, $string);
fclose($fp);
$filename = "abe2.txt";
$fp = fopen($filename, "w");
$string = 0;
$write = fputs($fp, $string);
fclose($fp);
}else{
$filename = "current.txt";
$fp = fopen($filename, "w");
$string = "ingen";
$write = fputs($fp, $string);
fclose($fp);
}
}
echo'<form method="post" action="?admin&ny">';
echo'<input type=text name="text" value="Dato - Klokken">';
echo'<input type=submit name="abe1" value="Opret Ny">';
echo'<input type=submit name="abe2" value="Stop">';
echo'</form>';
}else{
$filename = 'current.txt';
$fp = fopen($filename, "r");
$current = fread($fp, filesize($filename));
fclose($fp);
if($query[0] == "stemt" && ($_POST['abe1'] || $_POST['abe2']) && $_COOKIE["raid"] != $current){
setcookie("raid",$current,time()+60*60*24*30);
$filename = $_POST['abe1']?"abe1.txt":"abe2.txt";
$fp = fopen($filename, "r");
$c = fread($fp, filesize($filename));
fclose($fp);
$fp = fopen($filename, "w");
$string = $c + 1;
$write = fputs($fp, $string);
fclose($fp);
header("location: ?");
}else{
abe();
if ($current == "ingen") {
echo "Der er ingen Raid inden for nærmeste fremtid!";
}else {
echo "Der er raid: ".$current."! Skriv dig venligst på hvis du kan komme!<br>\n";
$filename = 'abe1.txt';
$fp = fopen($filename, "r");
$a1 = fread($fp, filesize($filename));
fclose($fp);
$filename = 'abe2.txt';
$fp = fopen($filename, "r");
$a2 = fread($fp, filesize($filename));
fclose($fp);
echo "Der er ".$a1." som kan komme og ".$a2." som ikke kan!<br>";
if($_COOKIE["raid"] != $current) {
echo'<form method="post" action="?stemt">';
echo'<input type=submit name="abe1" value="Kan">';
echo'<input type=submit name="abe2" value="Kan Ikke">';
echo'</form>';
}else{
echo "Du har stemt!<br>";
}
}
}
}
?>
<br><br><br>
####
Hjæælp :)
