armark1ng

Untitled

Apr 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.13 KB | None | 0 0
  1. <?php
  2. $validPass = "$%HSPASS123";
  3.  
  4. if($_GET['pass'] != $validPass /* && get_client_ip() != "" */) {
  5. echo "Access Denied! ";
  6. die();
  7. }
  8.  
  9. if(empty($_GET) || $_GET['username'] == ""
  10. || $_GET['rights'] == "" || $_GET['attack'] == "" || $_GET['total'] == "" || $_GET['defence'] == ""
  11. || $_GET['constitution'] == "" || $_GET['strength'] == "" || $_GET['ranged'] == "" || $_GET['magic'] == ""
  12. || $_GET['prayer'] == "" || $_GET['crafting'] == "" || $_GET['cooking'] == "" || $_GET['woodcutting'] == ""
  13. || $_GET['fletching'] == "" || $_GET['fishing'] == "" || $_GET['mining'] == "" || $_GET['smithing'] == ""
  14. || $_GET['firemaking'] == "" || $_GET['herblore'] == "" || $_GET['agility'] == "" || $_GET['thieving'] == ""
  15. || $_GET['slayer'] == "" || $_GET['farming'] == "" || $_GET['runecrafting'] == "" || $_GET['construction'] == ""
  16. || $_GET['hunter'] == "" || $_GET['summoning'] == "" || $_GET['dungeoneering'] == ""
  17. || $_GET['attackxp'] == "" || $_GET['totalxp'] == "" || $_GET['defencexp'] == ""
  18. || $_GET['constitutionxp'] == "" || $_GET['strengthxp'] == "" || $_GET['rangedxp'] == "" || $_GET['magicxp'] == ""
  19. || $_GET['prayerxp'] == "" || $_GET['craftingxp'] == "" || $_GET['cookingxp'] == "" || $_GET['woodcuttingxp'] == ""
  20. || $_GET['fletchingxp'] == "" || $_GET['fishingxp'] == "" || $_GET['miningxp'] == "" || $_GET['smithingxp'] == ""
  21. || $_GET['firemakingxp'] == "" || $_GET['herblorexp'] == "" || $_GET['agilityxp'] == "" || $_GET['thievingxp'] == ""
  22. || $_GET['slayerxp'] == "" || $_GET['farmingxp'] == "" || $_GET['runecraftingxp'] == "" || $_GET['constructionxp'] == ""
  23. || $_GET['hunterxp'] == "" || $_GET['summoningxp'] == "" || $_GET['dungeoneeringxp'] == "" || $_GET['combatlvl'] == ""
  24. || $_GET['titleid'] == "" || $_GET['prestige'] == "" || $_GET['gamemode'] == "") {
  25. echo "lol \n";
  26. die();
  27. }
  28.  
  29. // Create connection
  30. $con=mysqli_connect("mysql12.000webhost.com","a9040702_armar","789789hammah","a9040702_armar");
  31.  
  32. // Check connection
  33. if (mysqli_connect_errno($con))
  34. {
  35. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  36. }
  37.  
  38. echo "Connected \n";
  39.  
  40. if($_GET['oldname'] != null || $_GET['oldname'] != "") {
  41. $updateSkillsName = "update `stats` set `playerName` = '".$_GET['username']."' WHERE `playerName` = '".$_GET['oldname']."'";
  42. mysqli_query($con, $updateSkillsName);
  43. }
  44. $sqlSkills = "INSERT INTO `stats` (`player_name`, `rights`,`title_id`, `game_mode`, `prestige`,`totallvl`,`totalxp`,`combat_lvl`,`Attacklvl`,`Attackxp`,`Defencelvl`,`Defencexp`,`Strengthlvl`,`Strengthxp`,`Hitpointslvl`,`Hitpointsxp`,`Rangelvl`,`Rangexp`,`Prayerlvl`,`Prayerxp`,`Magiclvl`,`Magicxp`,`Cookinglvl`,`Cookingxp`,`Woodcuttinglvl`,`Woodcuttingxp`,`Fletchinglvl`,`Fletchingxp`,`Fishinglvl`,`Fishingxp`,`Firemakinglvl`,`Firemakingxp`,`Craftinglvl`,`Craftingxp`,`Smithinglvl`,`Smithingxp`,`Mininglvl`,`Miningxp`,`Herblorelvl`,`Herblorexp`,`Agilitylvl`,`Agilityxp`,`Thievinglvl`,`Thievingxp`,`Slayerlvl`,`Slayerxp`,`Farminglvl`,`Farmingxp`,`Runecraftlvl`,`Runecraftxp`, `Hunterlvl`, `Hunterxp`, `Constructionlvl`,`Constructionxp`, `Summoninglvl`, `Summoningxp`, `Dungeoneeringlvl`, `Dungeoneeringxp`)
  45. VALUES ('".$_GET['username']."',".$_GET['rights'].",".$_GET['titleid'].",".$_GET['gamemode'].",".$_GET['prestige'].",".$_GET['total'].",".$_GET['totalxp'].",".$_GET['combatlvl'].",".getLevel(0).",".getXp(0).",".getLevel(1).",".getXp(1).",".getLevel(2).",".getXp(2).",".getLevel(3).",".getXp(3).",".getLevel(4).",".getXp(4).",".getLevel(5).",".getXp(5).",".getLevel(6).",".getXp(6).",".getLevel(7).",".getXp(7).",".getLevel(8).",".getXp(8).",".getLevel(9).",".getXp(9).",".getLevel(10).",".getXp(10).",".getLevel(11).",".getXp(11).",".getLevel(12).",".getXp(12).",".getLevel(13).",".getXp(13).",".getLevel(14).",".getXp(14).",".getLevel(15).",".getXp(15).",".getLevel(16).",".getXp(16).",".getLevel(17).",".getXp(17).",".getLevel(18).",".getXp(18).",".getLevel(19).",".getXp(19).",".getLevel(20).",".getXp(20)."," . getLevel(21)."," . getXp(21) . "," .getLevel(22) . "," . getXp(22) . "," . getLevel(23) . "," . getXp(23)."," . getLevel(24) . "," . getXp(24).")
  46. ON DUPLICATE KEY UPDATE `rights` = ".$_GET['rights'].",`title_id` = ".$_GET['titleid'].",`game_mode` = ".$_GET['gamemode'].",`prestige` = ".$_GET['prestige'].",`totallvl` = ".$_GET['total'].",`totalxp` = ".$_GET['totalxp'].",`combat_lvl` = ".$_GET['combatlvl'].", `Attacklvl` = ".getLevel(0).", `Attackxp` = ".getXp(0).", `Defencelvl` = ".getLevel(1)." , `Defencexp` = ".getXp(1).", `Strengthlvl` = ".getLevel(2).", `Strengthxp` = ".getXp(2).",`Hitpointslvl` = ".getLevel(3).", `Hitpointsxp` = ".getXp(3).", `Rangelvl` = ".getLevel(4)." , `Rangexp` = ".getXp(4).", `Prayerlvl` = ".getLevel(5).", `Prayerxp` = ".getXp(5).", `Magiclvl` = ".getLevel(6).", `Magicxp` = ".getXp(6).", `Cookinglvl` = ".getLevel(7)." ,`Cookingxp` = ".getXp(7).",`Woodcuttinglvl` = ".getLevel(8).",`Woodcuttingxp` = ".getXp(8).",`Fletchinglvl` = ".getLevel(9).",`Fletchingxp` = ".getXp(9).",`Fishinglvl` = ".getLevel(10).",`Fishingxp` = ".getXp(10).",`Firemakinglvl` = ".getLevel(11).",`Firemakingxp` = ".getXp(11).",`Craftinglvl` = ".getLevel(12).",`Craftingxp` = ".getXp(12).",
  47. `Smithinglvl` = ".getLevel(13).",`Smithingxp` = ".getXp(13).",`Mininglvl` = ".getLevel(14).",`Miningxp` = ".getXp(14).",`Herblorelvl` = ".getLevel(15).",`Herblorexp` = ".getXp(15).",`Agilitylvl` = ".getLevel(16).",`Agilityxp` = ".getXp(16).",`Thievinglvl` = ".getLevel(17).",`Thievingxp` = ".getXp(17).",`Slayerlvl` = ".getLevel(18).",`Slayerxp` = ".getXp(18).",`Farminglvl` = ".getLevel(19).",`Farmingxp` = ".getXp(19).",`Runecraftlvl` = ".getLevel(20).",`Runecraftxp` = ".getXp(20).", `Hunterlvl` = ".getLevel(21).", `Hunterxp` = ".getXp(21).", `Constructionlvl` = ".getLevel(22).",`Constructionxp` = ".getXp(22).", `Summoninglvl` = ".getLevel(23).", `Summoningxp` = ".getXp(23).", `Dungeoneeringlvl` = ".getLevel(24).", `Dungeoneeringxp` = ".getXp(24).";";
  48.  
  49. mysqli_query($con, $sqlSkills);
  50. mysqli_close($con);
  51.  
  52. function getLevel($skillId) {
  53. $skillname = strtolower(findType($skillId));
  54. return $_GET[$skillname] == "" ? 1 : $_GET[$skillname];
  55. }
  56.  
  57. function getXp($skillId) {
  58. $skillname = strtolower(findType($skillId));
  59. return $_GET[$skillname."xp"] == "" ? 1 : $_GET[$skillname."xp"];
  60. }
  61.  
  62. function findType($type) {
  63. if($type == "0") {
  64. return "Attack";
  65. } else if($type == "1") {
  66. return "Defence";
  67. } else if($type == "2") {
  68. return "Strength";
  69. } else if($type == "3") {
  70. return "Constitution";
  71. } else if($type == "4") {
  72. return "Ranged";
  73. } else if($type == "5") {
  74. return "Prayer";
  75. } else if($type == "6") {
  76. return "Magic";
  77. } else if($type == "7") {
  78. return "Cooking";
  79. } else if($type == "8") {
  80. return "Woodcutting";
  81. } else if($type == "9") {
  82. return "Fletching";
  83. } else if($type == "10") {
  84. return "Fishing";
  85. } else if($type == "11") {
  86. return "Firemaking";
  87. } else if($type == "12") {
  88. return "Crafting";
  89. } else if($type == "13") {
  90. return "Smithing";
  91. } else if($type == "14") {
  92. return "Mining";
  93. } else if($type == "15") {
  94. return "Herblore";
  95. } else if($type == "16") {
  96. return "Agility";
  97. } else if($type == "17") {
  98. return "Thieving";
  99. } else if($type == "18") {
  100. return "Slayer";
  101. } else if($type == "19") {
  102. return "Farming";
  103. } else if($type == "20") {
  104. return "Runecrafting";
  105. } else if($type == "21") {
  106. return "Hunter";
  107. } else if($type == "22") {
  108. return "Construction";
  109. } else if($type == "23") {
  110. return "Summoning";
  111. } else if($type == "24") {
  112. return "Dungeoneering";
  113. }
  114.  
  115. }
  116.  
  117.  
  118. function get_client_ip() {
  119. $ipaddress = '';
  120. if ($_SERVER['HTTP_CLIENT_IP'])
  121. $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
  122. else if($_SERVER['HTTP_X_FORWARDED_FOR'])
  123. $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
  124. else if($_SERVER['HTTP_X_FORWARDED'])
  125. $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
  126. else if($_SERVER['HTTP_FORWARDED_FOR'])
  127. $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
  128. else if($_SERVER['HTTP_FORWARDED'])
  129. $ipaddress = $_SERVER['HTTP_FORWARDED'];
  130. else if($_SERVER['REMOTE_ADDR'])
  131. $ipaddress = $_SERVER['REMOTE_ADDR'];
  132. else
  133. $ipaddress = 'UNKNOWN';
  134.  
  135. return $ipaddress;
  136. }
  137. ?>
Advertisement
Add Comment
Please, Sign In to add comment