Jump to content
MakeWebGames

rating.php


montyash

Recommended Posts

Re: rating.php

<?php

include "globals.php";

 

if($_GET['ID'] == $userid)

{

die("<center>You cannot rate yourself.</center>");

}

if($_GET['change'] == 'up')

{

if($_GET['ID'])

{

$bumbums=mysql_query("SELECT * FROM rating WHERE rateD={$_GET['ID']} AND rateR=$userid",$c);

$bumbum=mysql_fetch_array($bumbums);

if($bumbum)

{

die("<center>You cannot do this more than once a day to a certain person.</center>");

}

mysql_query("UPDATE users SET rating=rating+1 WHERE userid={$_GET['ID']}",$c);

mysql_query("INSERT INTO rating VALUES ('','{$_GET['ID']}',$userid);",$c);

die("<center>You have given this user a positive rating.</center>");

}

die("<center>Invalid ID</center>");

}

if($_GET['change'] == 'down')

{

if($_GET['ID'] && $_GET['ID']!=$userid)

{

$bumbums=mysql_query("SELECT * FROM rating WHERE rateD={$_GET['ID']} AND rateR=$userid",$c);

$bumbum=mysql_fetch_array($bumbums);

if($bumbum)

{

die("<center>You cannot do this more than once a day to a certain person.</center>");

}

mysql_query("UPDATE users SET rating=rating-1 WHERE userid={$_GET['ID']} AND rating>0",$c);

mysql_query("INSERT INTO rating VALUES ('','{$_GET['ID']}',$userid);",$c);

die("<center>You have given this user a negative rating.</center>");

}

die("<center>Invalid ID</center>");

}

 

 

$h->endpage();

?>

Link to comment
Share on other sites

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.   Paste as plain text instead

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