I am having a problem since weeks ago that I can't solve because of my programming skill, I also do research in google and trying every day to fix it and no one worked for me, so I really need help..
Warning: Cannot modify header information - headers already sent by (output started at /folder/index.php:1) in /folder/index.php on line 8
Here is my code:
<?php
include "./dbcon/config.php";
if(isset($_COOKIE['ref_link'])){
$id = $_COOKIE['ref_link'];
} else {
$id = rand(1,9).date('Y').date('m').date('d').date('h').date('i').date('s');
$id = rand_uniqid($id);
setcookie("ref_link",$id,time()+(123*123));
$insert = "insert into cookie_ref(REF_val) values('".$id."');";
@mysql_query($insert);
}
$error = '';
if(isset($_GET['id'])){
$getip = "select * from cookie_ref_ips where IP_address = '".getRealIpAddr()."' and REF_val = '".$_GET['id']."'";
$getip_query = @mysql_query($getip);
if(@mysql_num_rows($getip_query) < 1){
$update = "update cookie_ref set REF_hits = REF_hits + 1 where REF_val = '".$_GET['id']."'";
@mysql_query($update);
$insertip = "insert into cookie_ref_ips(IP_address,REF_val) values('".getRealIpAddr()."','".$_GET['id']."')";
@mysql_query($insertip);
}else{
$error = "";
}
}
?>