阅读:1851回复:4
物品发送脚本!
本帖最后由 shevechco 于 2011-11-14 19:53 编辑
<?php function Connect () { mssql_connect('Server','UserName','Password') or die('Error: Connection to DB Failed.'); } Connect(); function InitForm(){ //layout for the form echo \"<strong>Send Items.</strong> <form name='select' method='post'> <lable>Character Name</lable><br/> <input type='text' name='char'/><br/> <lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/> <input type='text' name='item_name'/><br/> <lable>Item Amount</lable><br/> <input type='text' name='item_amount'/><br/> <lable>Item Upgrade Amount</lable><br/> <input type='text' name='item_upgrade'/><br/> <lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.) </lable><br/> <input type='text' name='item_element'/><br/> <lable>Element Upgrade Amount</lable><br/> <input type='text' name='element_upgrade'/><br/> <lable>ierced Amount</lable><br/> <input type='text' name='item_pierce'/><br/> <input type='submit'/> </form>\"; } function PostListener (){ //Add more post variables if needed and add them to initform() function aswell ################################ ##### Connection and Post ###### ################################ $name = @$_POST['char']; $ItemName = @$_POST['item_name']; $ItemAmount = @$_POST['item_amount']; $ItemId = @$_POST['item_id']; $ItemUpgrade = @$_POST['item_upgrade']; $ItemElement = @$_POST['item_element']; $ElementUpgrade = @$_POST['element_upgrade']; $ItemPierce = @$_POST['item_pierce']; ################################ //Check both variables for empty value if (!empty($_POST['char'])){ $find = mssql_query(\"select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where m_szName = '{$name}'\"); while ($row = mssql_fetch_object($find)){ echo \"You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>\"; $logs = mssql_query(\"INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], [serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], [m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', '{$ElementUpgrade}', '{$ItemPierce}');\"); } } } $InitForm = InitForm(); $Listener = PostListener(); ?> 将以上代码保存为*.php 个人测试过了,可以使用,自己汉化吧。 放在你网站下,登陆上去可以直接给玩家发送物品,包括精炼之类的物品。 mssql_connect('Server','UserName','Password') or die('Error: Connection to DB Server 数据库 UserName 数据库账户 Password 数据库密码 |
|
100% |
沙发#
发布于:2011-11-14 23:18
我顶你啊,老大,我是你粉丝啊!!!
|
|
板凳#
发布于:2011-11-14 23:46
me too~~push!!
|
|
地板#
发布于:2011-11-26 16:28
用户被禁言,该主题自动屏蔽! |
|
4楼#
发布于:2011-11-26 21:03
鄙视楼上
|
|