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 ?