• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

PHP: Sending a parcel to a specific character?

ultrkomm

New Member
Joined
Nov 6, 2011
Messages
76
Reaction score
3
Hi!

I want to add a button on my website that sends a parcel with 10 apples (don't ask me why) to a specific character.

How would I go about doing so?

Thanks!
 
I went with a solution that adds item (a stamped parcel with the apples in it) to the characters home depot upon login. Works fine.

Thanks though.
 
PHP:
if(isset($_POST['submit_form'])){
      // check if character exists
      $checkChar = mysql_query("SELECT * FROM `players` WHERE name='".$_POST['character_name']."' ");
      $r = mysql_fetch_assoc($checkChar);

if(!$r){ echo 'A character with this name does not exist!'; 
} else {
      // add item to players depot
      $itemID = 'XXXX';
      $itemCount = '1';

      $addItem = mysql_query("INSERT INTO `player_depotitems` (player_id, item_type, count) VALUES ('".$r['player_id']."', '".$itemID."', '".$itemCount."')");
      echo 'Item has been added to player <b>'.$_POST['character_name'].'</b> depot.';
}
}

  

<form action="" method="POST">

<input type="text" name="character_name" size="10"/>
<input type="submit" name="submit_form" value="Send item"/>

</form>

I think something like this, but I have no idea how to add containers filled with an item.

EDIT: just noticed you already had a solution, haha.
 

Similar threads

Back
Top