Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.59 KB | None | 0 0
  1. <?php
  2. //this needs to be on the login page as well as on all others.
  3. //user session info, UID
  4. session_start();
  5. $codeid = $_SESSION['codeid'];
  6.  
  7. $enteredpin = $_POST['Pin'];
  8. $username="webuser";
  9. $password="dyeHD3js69bLnc5G";
  10. $database="assassin";
  11. //connection line
  12. $connected = mysql_connect(localhost,$username,$password);
  13. if (!$connected) {
  14.     die('Could not connect: ' . mysql_error());
  15. }
  16.  
  17. //selects database
  18. mysql_select_db($database, $connected) or die('Unable to select database: ' . $mysql_error());
  19.  
  20. //assign new target
  21. $query2 = "SELECT targetuid FROM users WHERE pin = '$enteredpin'";
  22. $result = mysql_query($query2);
  23. $row = mysql_fetch_row($result,MYSQL_ASSOC);
  24. $targetuid_found = $row['targetuid'];
  25.  
  26. if (!$targetuid_found)
  27. {
  28. die('Could not find Target in database!'. mysql_error());
  29. }
  30. else
  31. {
  32.  
  33. $query = "update users set dead = 1 where pin = '$enteredpin'";
  34. mysql_query($query);
  35.  
  36. //UID of VICTIMS assassin
  37. $query2 = "SELECT uid FROM users WHERE targetuid = '$targetuid_found'";
  38. $result = mysql_query($query2);
  39. $row = mysql_fetch_row($result,MYSQL_ASSOC);
  40. $victims_assassin_uid = $row['uid'];
  41.  
  42. //this finds the TARGET of the VICTIM
  43. $query2 = "SELECT targetuid FROM users WHERE pin = '$enteredpin'";
  44. $result = mysql_query($query2);
  45. $row = mysql_fetch_row($result,MYSQL_ASSOC);
  46. $victims_target = $row['targetuid'];
  47.  
  48. //now we update the VICTIMS ASSASSINS target with the TARGET of the victim, oh yeah
  49. $query2 = "UPDATE users SET targetuid = '$victims_target' WHERE uid = '$victims_assassin_uid'";
  50. mysql_query($query2);
  51.  
  52.  
  53. print "Death Noted.";
  54. }
  55.  
  56.  
  57. mysql_close($connected);
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement