Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $validPass = "$%HSPASS123";
- if($_GET['pass'] != $validPass /* && get_client_ip() != "" */) {
- echo "Access Denied! ";
- die();
- }
- if(empty($_GET) || $_GET['username'] == ""
- || $_GET['rights'] == "" || $_GET['attack'] == "" || $_GET['total'] == "" || $_GET['defence'] == ""
- || $_GET['constitution'] == "" || $_GET['strength'] == "" || $_GET['ranged'] == "" || $_GET['magic'] == ""
- || $_GET['prayer'] == "" || $_GET['crafting'] == "" || $_GET['cooking'] == "" || $_GET['woodcutting'] == ""
- || $_GET['fletching'] == "" || $_GET['fishing'] == "" || $_GET['mining'] == "" || $_GET['smithing'] == ""
- || $_GET['firemaking'] == "" || $_GET['herblore'] == "" || $_GET['agility'] == "" || $_GET['thieving'] == ""
- || $_GET['slayer'] == "" || $_GET['farming'] == "" || $_GET['runecrafting'] == "" || $_GET['construction'] == ""
- || $_GET['hunter'] == "" || $_GET['summoning'] == "" || $_GET['dungeoneering'] == ""
- || $_GET['attackxp'] == "" || $_GET['totalxp'] == "" || $_GET['defencexp'] == ""
- || $_GET['constitutionxp'] == "" || $_GET['strengthxp'] == "" || $_GET['rangedxp'] == "" || $_GET['magicxp'] == ""
- || $_GET['prayerxp'] == "" || $_GET['craftingxp'] == "" || $_GET['cookingxp'] == "" || $_GET['woodcuttingxp'] == ""
- || $_GET['fletchingxp'] == "" || $_GET['fishingxp'] == "" || $_GET['miningxp'] == "" || $_GET['smithingxp'] == ""
- || $_GET['firemakingxp'] == "" || $_GET['herblorexp'] == "" || $_GET['agilityxp'] == "" || $_GET['thievingxp'] == ""
- || $_GET['slayerxp'] == "" || $_GET['farmingxp'] == "" || $_GET['runecraftingxp'] == "" || $_GET['constructionxp'] == ""
- || $_GET['hunterxp'] == "" || $_GET['summoningxp'] == "" || $_GET['dungeoneeringxp'] == "" || $_GET['combatlvl'] == ""
- || $_GET['titleid'] == "" || $_GET['prestige'] == "" || $_GET['gamemode'] == "") {
- echo "lol \n";
- die();
- }
- // Create connection
- $con=mysqli_connect("mysql12.000webhost.com","a9040702_armar","789789hammah","a9040702_armar");
- // Check connection
- if (mysqli_connect_errno($con))
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- echo "Connected \n";
- if($_GET['oldname'] != null || $_GET['oldname'] != "") {
- $updateSkillsName = "update `stats` set `playerName` = '".$_GET['username']."' WHERE `playerName` = '".$_GET['oldname']."'";
- mysqli_query($con, $updateSkillsName);
- }
- $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`)
- 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).")
- 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).",
- `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).";";
- mysqli_query($con, $sqlSkills);
- mysqli_close($con);
- function getLevel($skillId) {
- $skillname = strtolower(findType($skillId));
- return $_GET[$skillname] == "" ? 1 : $_GET[$skillname];
- }
- function getXp($skillId) {
- $skillname = strtolower(findType($skillId));
- return $_GET[$skillname."xp"] == "" ? 1 : $_GET[$skillname."xp"];
- }
- function findType($type) {
- if($type == "0") {
- return "Attack";
- } else if($type == "1") {
- return "Defence";
- } else if($type == "2") {
- return "Strength";
- } else if($type == "3") {
- return "Constitution";
- } else if($type == "4") {
- return "Ranged";
- } else if($type == "5") {
- return "Prayer";
- } else if($type == "6") {
- return "Magic";
- } else if($type == "7") {
- return "Cooking";
- } else if($type == "8") {
- return "Woodcutting";
- } else if($type == "9") {
- return "Fletching";
- } else if($type == "10") {
- return "Fishing";
- } else if($type == "11") {
- return "Firemaking";
- } else if($type == "12") {
- return "Crafting";
- } else if($type == "13") {
- return "Smithing";
- } else if($type == "14") {
- return "Mining";
- } else if($type == "15") {
- return "Herblore";
- } else if($type == "16") {
- return "Agility";
- } else if($type == "17") {
- return "Thieving";
- } else if($type == "18") {
- return "Slayer";
- } else if($type == "19") {
- return "Farming";
- } else if($type == "20") {
- return "Runecrafting";
- } else if($type == "21") {
- return "Hunter";
- } else if($type == "22") {
- return "Construction";
- } else if($type == "23") {
- return "Summoning";
- } else if($type == "24") {
- return "Dungeoneering";
- }
- }
- function get_client_ip() {
- $ipaddress = '';
- if ($_SERVER['HTTP_CLIENT_IP'])
- $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
- else if($_SERVER['HTTP_X_FORWARDED_FOR'])
- $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
- else if($_SERVER['HTTP_X_FORWARDED'])
- $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
- else if($_SERVER['HTTP_FORWARDED_FOR'])
- $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
- else if($_SERVER['HTTP_FORWARDED'])
- $ipaddress = $_SERVER['HTTP_FORWARDED'];
- else if($_SERVER['REMOTE_ADDR'])
- $ipaddress = $_SERVER['REMOTE_ADDR'];
- else
- $ipaddress = 'UNKNOWN';
- return $ipaddress;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment