Jump to content

Cha0s Blitz

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Cha0s Blitz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. oh this was off a tut aswell D: , just wondered if anyone knew what was wrong with it ;p
  2. oh ive set the database to set it as BLOB , ( binary large object ) or whatever , when i try to upload it i get the error 'problem uploading ' which echos from my query if it doesnt work so im so confused
  3. Ok , so im fairly new to this beeen watching tuts , messing around with coding to see what does what , well i cant seem to get this uploader to send a image to the db it just errors the code is <html> <head> <title>Image Uploader</title> </head> <body> <form method="post" action="index.php" enctype="multipart/form=data"> File: <input type="file" name="image" /> <input type="submit" value="upload" /> </form> <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); //file propities $file = $_FILES['image']['tmp_name']; if (!isset($file)) { echo "Please select an image"; } else { $image = file_get_contents ($_FILES['image']['tmp_name']); $image_name = $_FILES['image']['name']; $image_size = getimagesize($_FILES['image']['tmp_name']); if ($image_size==FALSE) echo "This is not an image file"; else { if (!$insert = mysql_query("INSERT INTO imagedb VALUES ('','$image_name','$image')")) echo "problem uploading image"; else { $lastid = mysql_insert_id(); echo "image uploaded<p>Your image</p><img scr =get.php?id=$lastid>"; } } } ?> </body> </html> thats my index.php then my get.php is <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); $id = addslashes($_REQUEST['id']); $image = mysql_query("SELECT * FROM imagedb WHERE id=$id"); $image = mysql_fetch_assoc($image); $image = $image['image']; header("Content-type: img/jpeg"); echo $image; ?> My database is called 'test' and my table is called 'imagedb' and i have 3 fields 'id'name'image. help would be much appriciated thankyouu
  4. how can i set this into a variable , if (p.rights >= 2) { Engine.playerItems.addItem(p, itemID,itemAmount); return; } if (p.wildernessZone(p.absX, p.absY)) { p.getActionSender().sendMessage(p, "You cannot spawn items while inside of the wilderness."); return; } int freeSpace = Engine.playerItems.freeSlotCount(p); if (Engine.playerItems.freeSlotCount(p) < 1) { p.getActionSender().sendMessage(p, "You do not have enough space in your inventory."); return; } if (itemAmount > freeSpace && !Engine.items.stackable(itemID)) { itemAmount = freeSpace; } boolean costsKills = false; int killCost = itemAmount * p.getKillCost(itemID); if (killCost > 0) { if (p.kills < killCost) { p.getActionSender().sendMessage(p, "You do not have enough kills to spawn this item."); p.getActionSender().sendMessage(p, "You need <col=991100>"+killCost+" kills</col> to spawn this item."); return; } costsKills = true; } if (p.getKillRequirment(itemID) > 0) { int killRequirment = p.getKillRequirment(itemID); if (p.totalKills < killRequirment) { p.getActionSender().sendMessage(p, "You have not unlocked the ability to spawn this item."); p.getActionSender().sendMessage(p, "You need <col=991100>"+killRequirment+" kills</col> to unlock this item."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } } int playerGold = Engine.playerItems.invItemCount(p, 995); String itemName = Engine.items.getItemName(itemID); String[] spawnDisabled = {"'perfect' ring", "'perfect'_ring", "null", "Coins", "(h", "/10", "100", "75", "50", "25"}; for (String s : spawnDisabled) { if (itemName.contains(s)) { p.getActionSender().sendMessage(p, "This item cannot be spawned."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } } if ((itemID >= 12000 && itemID != 13290)) { p.getActionSender().sendMessage(p, "This item cannot be spawned."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } int price = (int)Math.round(1.10 * (itemAmount * p.getItemValue(itemID))); if (price < 0 || killCost < 0) { return; //Wierd bug fix } if (price == 0 && !costsKills) { Engine.playerItems.addItem(p, itemID,itemAmount); p.getActionSender().addSoundEffect(p, 4041, 1, 0, 0); } else { if (playerGold < price) { p.getActionSender().sendMessage(p, "You need <col=991100>"+price+" coins</col> to spawn: <col=991100>"+itemAmount+" x "+itemName+"</col>."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); } else { if (!costsKills) { p.getActionSender().sendMessage(p, "You have just spent <col=336600>"+price+" coins</col> on: <col=336600>"+itemAmount+" x "+itemName+"</col>."); Engine.playerItems.addItem(p, itemID, itemAmount); p.getActionSender().addSoundEffect(p, 4044, 1, 0, 0); Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), price); } else { p.getActionSender().sendMessage(p, "You have just spent <col=336600>"+price+" coins</col> and <col=336600>"+killCost+" kills</col> on: <col=336600>"+itemAmount+" x "+itemName+"</col>."); Engine.playerItems.addItem(p, itemID, itemAmount); p.getActionSender().addSoundEffect(p, 4044, 1, 0, 0); Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), price); p.kills -= killCost; p.getActionSender().sendMessage(p, "You now have <col="+(p.kills > 0 ? "336600" : "991100")+">"+(p.kills > 0 ? p.kills : "no")+" kills</col> remaining."); } } } }
  5. can anyone tell me how i can set this as a variable if (p.rights >= 2) { Engine.playerItems.addItem(p, itemID,itemAmount); return; } if (p.wildernessZone(p.absX, p.absY)) { p.getActionSender().sendMessage(p, "You cannot spawn items while inside of the wilderness."); return; } int freeSpace = Engine.playerItems.freeSlotCount(p); if (Engine.playerItems.freeSlotCount(p) < 1) { p.getActionSender().sendMessage(p, "You do not have enough space in your inventory."); return; } if (itemAmount > freeSpace && !Engine.items.stackable(itemID)) { itemAmount = freeSpace; } boolean costsKills = false; int killCost = itemAmount * p.getKillCost(itemID); if (killCost > 0) { if (p.kills < killCost) { p.getActionSender().sendMessage(p, "You do not have enough kills to spawn this item."); p.getActionSender().sendMessage(p, "You need <col=991100>"+killCost+" kills</col> to spawn this item."); return; } costsKills = true; } if (p.getKillRequirment(itemID) > 0) { int killRequirment = p.getKillRequirment(itemID); if (p.totalKills < killRequirment) { p.getActionSender().sendMessage(p, "You have not unlocked the ability to spawn this item."); p.getActionSender().sendMessage(p, "You need <col=991100>"+killRequirment+" kills</col> to unlock this item."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } } int playerGold = Engine.playerItems.invItemCount(p, 995); String itemName = Engine.items.getItemName(itemID); String[] spawnDisabled = {"'perfect' ring", "'perfect'_ring", "null", "Coins", "(h", "/10", "100", "75", "50", "25"}; for (String s : spawnDisabled) { if (itemName.contains(s)) { p.getActionSender().sendMessage(p, "This item cannot be spawned."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } } if ((itemID >= 12000 && itemID != 13290)) { p.getActionSender().sendMessage(p, "This item cannot be spawned."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); return; } int price = (int)Math.round(1.10 * (itemAmount * p.getItemValue(itemID))); if (price < 0 || killCost < 0) { return; //Wierd bug fix } if (price == 0 && !costsKills) { Engine.playerItems.addItem(p, itemID,itemAmount); p.getActionSender().addSoundEffect(p, 4041, 1, 0, 0); } else { if (playerGold < price) { p.getActionSender().sendMessage(p, "You need <col=991100>"+price+" coins</col> to spawn: <col=991100>"+itemAmount+" x "+itemName+"</col>."); p.getActionSender().addSoundEffect(p, 4039, 1, 0, 0); } else { if (!costsKills) { p.getActionSender().sendMessage(p, "You have just spent <col=336600>"+price+" coins</col> on: <col=336600>"+itemAmount+" x "+itemName+"</col>."); Engine.playerItems.addItem(p, itemID, itemAmount); p.getActionSender().addSoundEffect(p, 4044, 1, 0, 0); Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), price); } else { p.getActionSender().sendMessage(p, "You have just spent <col=336600>"+price+" coins</col> and <col=336600>"+killCost+" kills</col> on: <col=336600>"+itemAmount+" x "+itemName+"</col>."); Engine.playerItems.addItem(p, itemID, itemAmount); p.getActionSender().addSoundEffect(p, 4044, 1, 0, 0); Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), price); p.kills -= killCost; p.getActionSender().sendMessage(p, "You now have <col="+(p.kills > 0 ? "336600" : "991100")+">"+(p.kills > 0 ? p.kills : "no")+" kills</col> remaining."); } } } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.