Probleem met headers
Warning: Cannot modify header information - headers already sent by
Ik heb hier het script:
<head><STYLE TYPE="text/css">
td{
font-size:9pt;
}
body{
background:#000000;
color:#FFFFFF;
font-size:8pt;
font-family:verdana;
}
A: Link {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Active {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Hover {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
A: Visited {font-family:Verdana;color:#FFFFFF;font-size:9pt;font-weight:normal;font-style:normal;background:#000000;text-decoration:none;}
</STYLE></head>
Code (php)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?
mysql_query("delete FROM kopers WHERE FROM_UNIXTIME(time,'%d') != FROM_UNIXTIME(unix_timestamp(),'%d')");
if ($_GET[id] == "") { header("location:http://www.probeerweb.nl"); exit; }
head();
$result = mysql_query("select * from kopers where ip='$_SERVER[REMOTE_ADDR]' AND verkoperid='$_GET[id]'") or die(mysql_error());
if ($row=mysql_fetch_array($result)) {
echo "Je hebt vandaag al geklikt!";
} else {
$result = mysql_query("select * from users where id=$_GET[id]");
if ($row = mysql_fetch_array($result)) {
if ($row[ref] != 0) {
$query = "UPDATE users SET refglaasjes=refglaasjes+1, euro=euro+$refprijs WHERE id=$row[ref]";
mysql_query($query);
}
mysql_query("UPDATE users SET glaasjes=glaasjes+1, euro=euro+$pdaprijs WHERE id=$_GET[id]") or die(mysql_error());
mysql_query("INSERT INTO kopers (ip, time, verkoperid) VALUES ('$_SERVER[REMOTE_ADDR]', UNIX_TIMESTAMP(), $_GET[id])");
// VOLGENS MIJ LIGT HET HIER AAN:
header("Location: klik.php");
} else {
echo "Uw klik is niet verwerkt";
}
}
foot();
?>
mysql_query("delete FROM kopers WHERE FROM_UNIXTIME(time,'%d') != FROM_UNIXTIME(unix_timestamp(),'%d')");
if ($_GET[id] == "") { header("location:http://www.probeerweb.nl"); exit; }
head();
$result = mysql_query("select * from kopers where ip='$_SERVER[REMOTE_ADDR]' AND verkoperid='$_GET[id]'") or die(mysql_error());
if ($row=mysql_fetch_array($result)) {
echo "Je hebt vandaag al geklikt!";
} else {
$result = mysql_query("select * from users where id=$_GET[id]");
if ($row = mysql_fetch_array($result)) {
if ($row[ref] != 0) {
$query = "UPDATE users SET refglaasjes=refglaasjes+1, euro=euro+$refprijs WHERE id=$row[ref]";
mysql_query($query);
}
mysql_query("UPDATE users SET glaasjes=glaasjes+1, euro=euro+$pdaprijs WHERE id=$_GET[id]") or die(mysql_error());
mysql_query("INSERT INTO kopers (ip, time, verkoperid) VALUES ('$_SERVER[REMOTE_ADDR]', UNIX_TIMESTAMP(), $_GET[id])");
// VOLGENS MIJ LIGT HET HIER AAN:
header("Location: klik.php");
} else {
echo "Uw klik is niet verwerkt";
}
}
foot();
?>
Output buffering kan dit wel oplossen ..
wat moet ik dus nu doen?
Code (php)
Code (php)
1
2
3
4
2
3
4
<?
mysql_query("delete FROM kopers WHERE FROM_UNIXTIME(time,'%d') != FROM_UNIXTIME(unix_timestamp(),'%d')");
if ($_GET[id] == "") { header("location:http://www.probeerweb.nl"); exit; }
?>
mysql_query("delete FROM kopers WHERE FROM_UNIXTIME(time,'%d') != FROM_UNIXTIME(unix_timestamp(),'%d')");
if ($_GET[id] == "") { header("location:http://www.probeerweb.nl"); exit; }
?>
bovenaan je pagina zetten ;)