Jump to content
V3ct0r

[PHP] Search for items

Recommended Posts

item_search.png

 

With this PHP script you can search for different items in characters bag, temporary bag and bank.

 

Requirements:

  1. PHP 7.0+;
  2. PDO support;
  3. sqlsrv driver for PDO.

 

How to install and use:

1) Put the script to your web server working folder, usually it named htdocs.

2) Open index.php and configure it;

 

First of all, fill the data to connect to the MSSQL server:

// MSSQL Settings
$db_host = '';
$db_user = '';
$db_pass = '';
$db_name = 'GameDB';

Then enter the access key. It is needed to access the script from the web browser.

// Secret key
$access_key = 'E10ADC3949BA59ABBE56E057F20F883E';

Fill the list of items you need to search for:

// List of items to search for
// ID, Name, Icon
$items = array(
	// new Item(Item_ID, 'Item_Name', 'Item_Icon'),
	new Item(1,    'Short sword',    'w0001'),
	new Item(2,    'Long sword',     'w0002'),
	new Item(863,  'Gem of Rage',    'n1182'),
	new Item(855,  'Fairy Coin',     'n1482'),
	new Item(1847, 'Apple',          'n0275')
);

That's all!

 

3) Run the script in the your web browser and you will see the results of the search.

http://localhost/search_items/index.php

 

The script is based on the PHP class for working with inventory from user Matt from forum serverdev.net. Icons of items are included. Do not use on a production server for security reasons.

 

Download

 

On 6/8/2018 at 11:26 PM, SoundX said:

to avoid `count()` compatibility issue if someone uses PHP 7.2:

 

In `class.inventory.php`, line 21:


$itemAttrCount = count((array)$item);

 

  • Thanks 4

Share this post


Link to post
Share on other sites

Thank you, very useful.

 

Also to avoid `count()` compatibility issue if someone uses PHP 7.2:

 

In `class.inventory.php`, line 21:

$itemAttrCount = count((array)$item);

 

  • Like 1

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...