Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ((isset ($_GET['good'])))
- { $goodid = (int)$_GET['good'];
- if ($goodid == 0){echo "<h2><strong>Reputation Error</strong></h2>";}
- else{
- if ($goodid == $_SESSION['SESS_MEMBER_ID']) {echo "<h2>You cannot give reputation to you're self</h2>";}
- else{
- $mymymyid = $_SESSION['SESS_MEMBER_ID'];
- $query = "SELECT * FROM rep WHERE member_id='$goodid' and giver_id='$mymymyid' " or die("<br/>hihi<br/>".mysql_error());
- $result = mysql_query($query) or die(mysql_error());
- if (mysql_num_rows($result) )
- {
- print '<h2><strong>You have already gave this user a reputation</strong></h2>';
- }
- else
- {
- $count_ifuserexists = mysql_query("SELECT COUNT(member_id) FROM members WHERE member_id=$goodid") or die("<br/>hihi<br/>".mysql_error());
- $c_iue = mysql_fetch_row($count_ifuserexists);
- if ($c_iue == 1) {
- $query = mysql_query("INSERT INTO rep (member_id, giver_id, good) VALUES ('$goodid', '$mymymyid', '1')") or die("<br/>hihi<br/>".mysql_error());
- if($query) {
- echo "<h2><strong>Reputation Added</strong></h2>";
- } else {
- echo "<h2><strong>Reputation Error</strong></h2>";
- }}
- else echo "<h2><strong>User Doesn't Exist</strong></h2>";
- }
- }
- }
- }
- else if((isset ($_GET['bad'])))
- { $badid = (int)$_GET['bad'];
- if ($badid == $_SESSION['SESS_MEMBER_ID']) {echo "<h2> You cannot give youreself bad reputation</h2>";}
- else {
- echo "<h2><strong> Negative Reputation Added </strong></h2>";
- }} else
- echo header("location: profile.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement