飞飞世界论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 14230|回复: 0
打印 上一主题 下一主题

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php# f2 E- W, c  M
function Connect () {
7 @& ^. D! J* }' ~8 ]3 ?4 @3 omssql_connect('Server','UserName','Password') or die('Error: Connection to DB 9 t7 e  n: l$ ^2 ~0 _3 i- K% r
3 }3 _7 u; w# o% V& `
Failed.');( G; `/ l; n1 c1 T. T
}
1 L( q* }+ M+ oConnect();
7 J- Z* k, b, K. P8 \( Z3 y5 i& B9 F; T2 t4 y
function InitForm(){
/ }$ o5 k* F+ P8 N//layout for the form
4 Y% n9 e( F9 Gecho "<strong>Send Items.</strong>" l, C8 S+ F& a5 i5 k6 I' q( ~
<form name='select' method='post'>
! e- r% K, Y- D3 B% ^<lable>Character Name</lable><br/>
" i1 ~4 O# c, p& N, |  T! w<input type='text' name='char'/><br/>
8 }3 _! e8 A2 j( Q<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
" F+ X- @* f5 o<input type='text' name='item_name'/><br/>
: V) o0 E$ L) m) X( K+ B<lable>Item Amount</lable><br/>) @  b" ~6 F2 I
<input type='text' name='item_amount'/><br/>
1 Q& J& ]- a- Z5 l1 H<lable>Item Upgrade Amount</lable><br/>
6 C& U: n* _/ Z  D<input type='text' name='item_upgrade'/><br/>
+ m! M+ {# ~5 q' g<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)1 x6 T& i; U3 t1 i( I: I
" d/ T4 @4 z% K* y3 Z
</lable><br/>( g, G; I. M4 q
<input type='text' name='item_element'/><br/># a' d. {% _2 W# q+ I& X& T; q
<lable>Element Upgrade Amount</lable><br/>" t- y% ~+ P/ c- i  H( V: v
<input type='text' name='element_upgrade'/><br/>
3 V. j4 `7 g, V$ y<lable>Pierced Amount</lable><br/>
& W6 `9 B% u" R6 ]; b7 N. e, M<input type='text' name='item_pierce'/><br/>( a& h0 s+ V* U& u# Z4 ?
<input type='submit'/>  |' b; l+ J* p  [
</form>";* z6 Q% R3 P1 Q' H
}
1 O" F5 X' }# Y1 V: X3 o# d9 t% Z6 t: l) w
function PostListener (){
  w" F  `! B' E4 ~, ~5 a/ `//Add more post variables if needed and add them to initform() function aswell5 i( T# s& ?7 i2 }- ~) H+ G; r4 J

# z9 l: r0 o6 U0 v: s6 i################################. A/ F' s# B+ v8 f+ h+ m
##### Connection and Post ######
- g* P; t) M! G+ ]1 |################################
+ v7 s+ {7 K" h5 y/ w$name = @$_POST['char'];( ^" l' a5 O. ?! W
$ItemName = @$_POST['item_name'];
9 s+ j/ r  X  A$ItemAmount = @$_POST['item_amount'];" ~( v# h- Y' o" f) q' X5 z2 R/ g
$ItemId = @$_POST['item_id'];
( U( ^% _8 [, M' L, B) @- @$ItemUpgrade = @$_POST['item_upgrade'];
# K$ V* n- |. ~8 l  r7 K( e$ItemElement = @$_POST['item_element'];
# t4 ^. N% x4 i+ I0 a* ~5 @$ElementUpgrade = @$_POST['element_upgrade'];" H( o0 k" E4 f" \8 u2 i( q
$ItemPierce = @$_POST['item_pierce'];4 H; V- P# W( s  U
################################  M% s; j$ e# c0 J8 T% ^
+ v$ ~7 ]4 ^( y/ Q# Z
//Check both variables for empty value
# V( V5 D9 d( K  f( K/ u; L5 x2 W# c) z) m; r  H6 _* Y% ^
if (!empty($_POST['char'])){: c: G( S5 w  y' H. U* @$ U; n
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where " d  i( v% w% M& _

4 _! R. v# z' A: Y* l, M+ Hm_szName = '{$name}'");
; w5 ]# \2 y+ i$ _- n1 a: dwhile ($row = mssql_fetch_object($find)){
, k* b* V8 t% Iecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";) R5 k* [6 A% a7 U
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
+ I0 V! V5 l$ M6 M3 f7 n( o
( z+ C* O' V0 }3 T& a[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ; h" T  ?' z- c
1 |' N- B0 q. {. x. e8 O& u" P
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 4 z. G+ m/ a5 V1 ~
" p6 l$ _2 u4 E7 W; I+ U
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
7 f% T/ W, E  k' \3 J( |6 t# z9 n, K6 b' {- ^8 z* G8 Q
'{$ElementUpgrade}', '{$ItemPierce}');");
9 Y- r8 y8 F8 k3 G: L& t/ I9 @}
+ B9 V5 W, E4 t
. y& q' m' C+ q9 M0 M: m' A}
* }- z% O: ^+ z4 E' r5 x! @1 z7 }8 f/ h7 ?" N8 x" o
}
; e& j" z# |0 A( q9 u
- C2 g$ G4 }9 N; j. d: U$InitForm = InitForm();
' M, n% M0 ]; u; `$Listener = PostListener();0 w# k1 A+ h; L
* ]; W+ q% ^. F% }/ N$ O
?>3 i, w) Z$ z& }; p$ G+ [
1 N, J+ [1 E6 h8 v4 `

! h9 V) \# D" Q7 k+ W
- v% d2 \' z! _! J0 E# @  s4 K9 @7 H; {2 _8 F3 B! p, j
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|飞飞世界技术论坛  

GMT+8, 2025-12-21 04:28 , Processed in 0.063522 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表