Jump to content

please help me make a rating script


jck

Recommended Posts

<?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.