i have problem at my affiliate script : index.php?id=34343 change to index.php?id=0 so this script don't have stats for user id=34343 but have stats at admin id=0 please someone help me.... i spend 2 weeks to find whats wrong this script... but not found yet if(mysql_errno()){ $_SESSION[Error] = "The Database link has not been setup."; header("Location: message.php"); exit; } $id = 0; $_SESSION[ReferredUser] = $id; if(isset($_REQUEST[ID])){ if_exists_db($Stats, $StatsName); if_exists_db($MemberDetails, $MemberDetailsName); $SQL="Select id From MemberDetails Where Code='$_REQUEST[ID]'"; $res = @ mysql_query($SQL); //Get the number of hits for this user from this address if(@ (mysql_num_rows($res)>0)){ $row= @ mysql_fetch_row($res); $id = $row[0]; } } $SQL="Select Hits From Stats Where IPAddress='$_SERVER[REMOTE_ADDR]' And id=$id And SignedUp=0;"; $res = @ mysql_query($SQL); if(mysql_errno()){ domysql_error($SQL, __FILE__); } else { //Get the number of hits for this user from this address if(@ (mysql_num_rows($res)>0)){ $row= @ mysql_fetch_row($res); $Hits = $row[0]; } else { $Hits=0; } if(mysql_errno()){ domysql_error($SQL, __FILE__); } else { $Hits++; //Create the SQL command if($Hits==1){ $SQL = "Insert Into Stats (IPAddress, id, Hits, SignedUp, SignedUpID) Values ('$_SERVER[REMOTE_ADDR]', $id, $Hits, 0, 0)"; } else { $SQL = "Update Stats Set Hits=$Hits Where IPAddress='$_SERVER[REMOTE_ADDR]' And id = $id And SignedUp=0"; } @ mysql_query($SQL, $conn); if(mysql_errno()){ domysql_error($SQL, __FILE__); } else { $_SESSION[ReferredUser]=$id; } } } header("Location: $FireSaleHomePage?ID=$id"); ?> Code (markup): thanks mates
lol no want to help me... so how much if i want hire someone to make this job done? please pm me or just post your rate... i have small budget
Thats horribly insecure . I believe the error is your setting $id , but calling upon $ID . PHP is case sensitive. You need to start using proper syntax as well.. that might cause some of your troubles. ($fromdb['good'] instead of $fromdb[bad] )
ok thanks the problem is... my user affiliate link will change to admin affiliate here to make it clear index.php?id=34343 <---- this my user affiliate link.... after someone click that affiliate link it will change to index.php?id=0 <--- 0 for admin id the stats click not show to my user affiliate panel... but it show at admin stats click panel