jck Posted July 11, 2007 Share Posted July 11, 2007 <? require_once("conn.php"); //check the user Huh $q1 = "select * from dd_rating where ItemID = '$_POST[itemID]' and ip = '$_SERVER[REMOTE_ADDR]' "; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) == '0') { $q2 = "insert into dd_rating set ItemID = '$_POST[itemID]', Rating = '$_POST[rr]', ip = '$_SERVER[REMOTE_ADDR]' "; mysql_query($q2) or die(mysql_error()); header("location:$_SERVER[HTTP_REFERER]&rate_error=n"); } else { header("location:$_SERVER[HTTP_REFERER]&rate_error=y"); } ?> i rated and then my friend voted then when i vote again it says that i cannot vote so check out this script and tell me if it stores all ips please Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted July 11, 2007 Share Posted July 11, 2007 i think the if statement should be : if(something==0) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.