Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Warning: Cannot modify header information
Forum PHP.pl > Forum > PHP
zaba12
mam taki blad:

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\WebServ\httpd\a\func.php:1976) in C:\Program Files\WebServ\httpd\a\func.php on line 19

Tutaj kawalek kodu..

<?php
$db_id = mysql_connect("localhost", "root", "")
or die("Could not connect to DB.");
mysql_select_db("games", $db_id)
or die("Database not found.");
//time difference; gets for how much the mysql server time is ahead, compared to the http server time;
$query="SELECT timediff(now(), '".date("Y-m-d H:i:s")."')";
$result=mysql_query($query, $db_id);
$tdif=mysql_fetch_row($result); $tdif=explode(":", $tdif[0]);
if ($tdif[0][0]=="-") {$tdif[0]=abs($tdif[0]); $tdif[3]="-";}
else $tdif[3]="+"; $tdif=" ".$tdif[3]." interval ".$tdif[0]." hour ".$tdif[3]." interval ".$tdif[1]." minute ".$tdif[3]." interval ".$tdif[2]." second";

if (isset($_SESSION["user"][0])) {$faction=faction($_SESSION["user"][10]); $imgs=$_SESSION["user"][13]; $fimgs=$faction[2];}
else {$imgs="default/"; $fimgs="1/";}

function msg($msg)
{
header("Location: msg.php?msg=".$msg);
}

function label($msg)
{
echo "<font face=\"Fixedsys\" color=\"red\">".$msg."</font>";}

function gen_stats($dur)
{
global $db_id;

$query="SELECT count(*) FROM users";
$result=mysql_query($query, $db_id);
$row[0]=mysql_fetch_row($result);
$query="SELECT count(*) FROM users where hour(timediff(now(), lastVisit))<".$dur;
$result=mysql_query($query, $db_id);
$row[1]=mysql_fetch_row($result);

return $row;
}

function clean_u($dur)
{
global $db_id;

$query="SELECT id FROM users where hour(timediff(now(), lastVisit))/24>".$dur;
$result=mysql_query($query, $db_id); $nr=0;
for (; $row=mysql_fetch_row($result); $nr++) del_u($row[0]);



Wie ktos moze co na takie cos mozna poradzic ?
c3zi
Daj na początku skryptu:

  1. <?php
  2. ?>


Na dole:

  1. <? ob_flush(); ?>
nospor
1) ponad 200 postow i nie wiesz co to bbcode?
2) problem poruszany milion razy, uzyj wyszukiwarki

zamykam
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.