Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 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="noneforyouToe";
  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.  
  21. $query = "update users set dead = 1 where pin = '$enteredpin'";
  22. mysql_query($query);
  23.  
  24. //assign new target
  25. $query2 = "SELECT targetuid FROM users WHERE uid = '$enteredpin'";
  26. $result = mysql_query($query2);
  27. $row = mysql_fetch_row($result,MYSQL_ASSOC);
  28. $location = $row['targetuid'];
  29.  
  30. if ($targetuid_found !== 2)
  31. {
  32. die('Could not find Target in database!'. mysql_error());
  33. }
  34. else
  35. {
  36.  
  37. $query3 = "UPDATE users SET targetuid = '".$targetuid_found."' WHERE uid = '$codeid'";
  38. mysql_query($query3);
  39. print "Death Noted.";
  40. }
  41.  
  42.  
  43. mysql_close($connected);
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement