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 Link to comment https://forums.phpfreaks.com/topic/59388-please-help-me-make-a-rating-script/ 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) Link to comment https://forums.phpfreaks.com/topic/59388-please-help-me-make-a-rating-script/#findComment-295120 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.