".$userobj["lastshown"]." AND isenabled=1 ORDER BY num"); if (!($nextsites = mysql_fetch_array($nextsites))) { $nextsites = mysql_query("SELECT * FROM websites WHERE uname='".$user."' AND isenabled=1 ORDER BY num"); if (!($nextsites = mysql_fetch_array($nextsites))) { header("location: default.php?aff=".$user); exit; } } $newsite = $nextsites["website"]; $coopuname = $nextsites["sitedscn"]; mysql_query("UPDATE users SET lastshown=".$nextsites["num"].",showntimes=1,numvisits=numvisits+1 WHERE uname='".$user."'"); mysql_query("UPDATE websites SET numvisits=numvisits+1 WHERE uname='".$user."' AND num=".$nextsites["num"]." and website='$newsite'"); if ($user == "affcoop" or $user == "maincoop") { mysql_query("UPDATE coop SET totalhits=totalhits+1 WHERE uname='".$coopuname."' AND website='$newsite'"); } if ($user == "fctc") { mysql_query("UPDATE fctccoop SET totalhits=totalhits+1 WHERE uname='".$coopuname."' AND website='$newsite'"); } header("location: http://".$newsite); exit; ?>