PHP interesse |
|
ik heb een fout met mijn headers!
eerst deden ze het wel maar nu niet meer weet iemand waarom?
dit is de fout:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/college2schoolkrant.be/httpdocs/widdershoven/webshop/config.inc:2) in /var/www/vhosts/college2schoolkrant.be/httpdocs/widdershoven/webshop/index.php on line 11
en dit is mijn index:
<?
// Open database...
include "config.inc";
$db = @mysql_connect("localhost", "$databaseuser", "$databasepasswd");
@mysql_select_db("$databasename",$db);
// Check if affiliateID is in the database...
$sql="SELECT affiliateid FROM affiliate WHERE affiliateid='$id'";
$result = @mysql_query("$sql",$db);
if (@mysql_num_rows($result) == 0) {
header("Location: main.php");
exit();
} else {
$sql="SELECT clicks FROM affiliatestats WHERE affiliateid='$id'";
$result = @mysql_query("$sql",$db);
$clicks = @mysql_result($result, 0, "clicks");
$sql = "UPDATE affiliatestats SET clicks=$clicks+1 WHERE affiliateid='$id'";
$result = @mysql_query("$sql",$db);
setcookie("affiliate","$id", mktime(0,0,0,12,1,2020));
header("Location: main.php");
}
?>
<? // Open database... include "config.inc"; $db = @mysql_connect("localhost", "$databaseuser", "$databasepasswd"); // Check if affiliateID is in the database... $sql="SELECT affiliateid FROM affiliate WHERE affiliateid='$id'"; } else { $sql="SELECT clicks FROM affiliatestats WHERE affiliateid='$id'"; $sql = "UPDATE affiliatestats SET clicks=$clicks+1 WHERE affiliateid='$id'"; } ?>
alvast bedankt voor de hulp
|