If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

function new_ref(){$userip=$_SERVER['REMOTE_ADDR'];$query="SELECT * FROM cookie_ref_ips WHERE IP_address='$userip'";$exe=mysql_query($query);$num=mysql_num_rows($exe) or die(mysql_error());if ($num==0){$refval=getRandomString(10);

$query="SELECT * FROM cookie_ref_ips WHERE REF_val='$refval'";$exe=mysql_query($query);$num=mysql_num_rows($exe) or die(mysql_error());if($num==0){$query="INSERT INTO cookie_ref_ips(IP_address,REF_val) values('$userip','$refval')";mysql_query($query);$query="INSERT INTO cookie_ref(REF_hits,ip,REF_val) values('0','$userip','$refval')";mysql_query($query);}}$query="INSERT INTO cookie_ref(IP_address,REF_val) values('$userip','$refval')";

function get_link(){$userip=$_SERVER['REMOTE_ADDR'];$query="SELECT * FROM cookie_ref_ips WHERE IP_address='$userip'";$exe=mysql_query($query);$exe2=mysql_fetch_array($exe) or die(mysql_error());$referal=$exe2['REF_val'];

return $referal;}

function update_hits(){

if(isset($_GET['ref'])){$ip=$_SERVER['REMOTE_ADDR'];

$ref=$_GET['ref'];

$query="SELECT * FROM cookie_ref WHERE REF_val='$ref'";$exe=mysql_query($query);$result=mysql_fetch_array($exe);$Oip=$result['ip'];$hit_temp=$result['REF_hits'];$hit_temp++;

if($ip!=$Oip){

$query="UPDATE cookie_ref set REF_hits='$hit_temp' WHERE REF_val='$ref'";mysql_query($query);}

}

}

function count_hits(){$userip=$_SERVER['REMOTE_ADDR'];$query="SELECT * FROM cookie_ref WHERE ip='$userip'";$exe=mysql_query($query);$result=mysql_fetch_array($exe) or die(mysql_error());

Since you have error reporting set to its highest level, it's going to fail on the smallest thing. In this case, it's because of server configuration using predefined variables. Although I have no clue why that one is...

Try changing the error reporting to 0 instead of all, just for a test...

If the post was helpful...Rate it! Remember to use [code] or [php] tags.