Guest User

Untitled

a guest
Feb 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. if ((isset ($_GET['good'])))
  2. { $goodid = (int)$_GET['good'];
  3.     if ($goodid == 0){echo "<h2><strong>Reputation Error</strong></h2>";}
  4.     else{
  5. if ($goodid == $_SESSION['SESS_MEMBER_ID']) {echo "<h2>You cannot give reputation to you're self</h2>";}
  6. else{
  7.     $mymymyid = $_SESSION['SESS_MEMBER_ID'];
  8.     $query = "SELECT * FROM rep WHERE member_id='$goodid' and giver_id='$mymymyid' ";
  9. $result = mysql_query($query) or die(mysql_error());
  10.  
  11. if (mysql_num_rows($result) )
  12. {
  13.     print '<h2><strong>You have already gave this user a reputation</strong></h2>';
  14. }
  15. else
  16. {
  17.     $query = mysql_query("INSERT INTO rep (member_id, giver_id, good) VALUES ('$goodid', '$mymymyid', '1')");;
  18. if($query) {
  19. echo "<h2><strong>Reputation Added</strong></h2>";
  20. } else {
  21. echo "<h2><strong>Reputation Error</strong></h2>";
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment