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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.