Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //this needs to be on the login page as well as on all others.
- //user session info, UID
- session_start();
- $codeid = $_SESSION['codeid'];
- $enteredpin = $_POST['Pin'];
- $username="webuser";
- $password="dyeHD3js69bLnc5G";
- $database="assassin";
- //connection line
- $connected = mysql_connect(localhost,$username,$password);
- if (!$connected) {
- die('Could not connect: ' . mysql_error());
- }
- //selects database
- mysql_select_db($database, $connected) or die('Unable to select database: ' . $mysql_error());
- //assign new target
- $query2 = "SELECT targetuid FROM users WHERE pin = '$enteredpin'";
- $result = mysql_query($query2);
- $row = mysql_fetch_row($result,MYSQL_ASSOC);
- $targetuid_found = $row['targetuid'];
- if (!$targetuid_found)
- {
- die('Could not find Target in database!'. mysql_error());
- }
- else
- {
- $query = "update users set dead = 1 where pin = '$enteredpin'";
- mysql_query($query);
- //UID of VICTIMS assassin
- $query2 = "SELECT uid FROM users WHERE targetuid = '$targetuid_found'";
- $result = mysql_query($query2);
- $row = mysql_fetch_row($result,MYSQL_ASSOC);
- $victims_assassin_uid = $row['uid'];
- //this finds the TARGET of the VICTIM
- $query2 = "SELECT targetuid FROM users WHERE pin = '$enteredpin'";
- $result = mysql_query($query2);
- $row = mysql_fetch_row($result,MYSQL_ASSOC);
- $victims_target = $row['targetuid'];
- //now we update the VICTIMS ASSASSINS target with the TARGET of the victim, oh yeah
- $query2 = "UPDATE users SET targetuid = '$victims_target' WHERE uid = '$victims_assassin_uid'";
- mysql_query($query2);
- print "Death Noted.";
- }
- mysql_close($connected);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement