飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1090

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1090
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php1 c( ]- ?4 ]4 ~; j: g; `
function Connect () {
4 X# t6 C: o% M; {mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
5 \% B) M  T. C/ l9 P/ N& J% }# a0 K, y7 D
Failed.');5 H) |* L8 Z$ |. h9 j4 t5 j
}
$ m  O& P7 L! C8 P0 Z, DConnect();
2 d/ p, S$ v2 u6 t, p& T( W, t: _6 e8 D4 ^- m4 s
function InitForm(){
9 ~2 Y+ Q6 A: x$ j6 p" d! h//layout for the form1 g4 k5 H# `: J  I  @
echo "<strong>Send Items.</strong>1 T! }% z( E+ M
<form name='select' method='post'>
' Q' |) p5 O, s3 f5 j: b4 r<lable>Character Name</lable><br/>9 i& l" ~5 c% |1 @% ?
<input type='text' name='char'/><br/>( s) L/ v# r! g& L; p; S0 ^7 ^  }
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>! T. B) b" T9 x4 a1 g  c
<input type='text' name='item_name'/><br/>
( T4 M( J( H  P! y+ p& i<lable>Item Amount</lable><br/>
6 n9 r9 {; o3 P  e& t$ u<input type='text' name='item_amount'/><br/>
! K0 l# u& q0 n# o# t<lable>Item Upgrade Amount</lable><br/>
0 X5 B: H# c) p1 I5 i0 t% A' H<input type='text' name='item_upgrade'/><br/>
; x5 d8 w* a. w3 `. |: M0 z<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)- P/ s( U) O2 V" j0 v9 n% }+ r5 \

" N5 H5 N8 g1 l4 Z" N& G% X* N</lable><br/>( k% C( B3 w7 {7 K- W+ x4 {
<input type='text' name='item_element'/><br/>% @$ K6 l* ?) s! m% c' o" L) u4 j
<lable>Element Upgrade Amount</lable><br/>3 n4 F1 R1 D4 s* k
<input type='text' name='element_upgrade'/><br/>
7 ?, ~  P: v$ b9 A5 i<lable>Pierced Amount</lable><br/>
' w& V7 X1 }* t8 u9 O; n<input type='text' name='item_pierce'/><br/>5 r4 H! _3 f# @
<input type='submit'/>/ W5 |& q) n1 _/ `- ?
</form>";; y/ n( T8 k' E" H! L
}+ Z* W/ Y/ Z7 C) S
1 Y/ K9 h$ O' B* X& x" [
function PostListener (){
4 V: e! X3 T( R! }% F# ?//Add more post variables if needed and add them to initform() function aswell
/ s: D! y7 A9 v4 H5 x- K& j3 E
6 s5 ^# t; V# b/ h8 A################################8 o" K) q  x: H! v. _! I$ \9 O
##### Connection and Post ######1 A& y4 j9 T! s# b6 [
################################  X% N! x  s9 p/ t# x: M* ?5 }
$name = @$_POST['char'];
2 `. T* |/ S# v7 B, Q: X# Q0 h$ItemName = @$_POST['item_name'];
4 `( J7 T; [4 b1 j2 f" N8 a6 B$ItemAmount = @$_POST['item_amount'];0 n9 E/ p# B# l: ~+ d4 f
$ItemId = @$_POST['item_id'];
8 G- w% C4 F$ q" M/ L$ItemUpgrade = @$_POST['item_upgrade'];
) O" }  w% \  E, L$ItemElement = @$_POST['item_element'];& z# Y! B2 [- l0 o
$ElementUpgrade = @$_POST['element_upgrade'];& v# S4 N' P& H( t4 s1 u
$ItemPierce = @$_POST['item_pierce'];4 ^1 d/ Q8 ~# C* c
################################
( ~  y: K* c' A. H' a  Y
8 N; \5 v- @; _//Check both variables for empty value
$ E" y- O0 {1 F, ~) b7 e# u9 V& ~
6 \+ B" H; P# o2 w$ vif (!empty($_POST['char'])){! B: Q$ E* b8 ~, n! n& W4 }2 \
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
4 T6 r, e2 r: c2 X" @! a; I# E& `* P6 O+ }( b  D" k
m_szName = '{$name}'");
4 C9 U0 G0 ?/ R8 g1 m6 J+ @' R" d/ `while ($row = mssql_fetch_object($find)){0 U4 d; N% E- _- M) V+ K
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";7 A' [- \9 o# N; b6 X
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 7 W$ C; O0 |. R: ^6 Y

, `% g0 _" v$ n) z( [6 V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
# k  t4 E( J4 A2 R( N5 X$ \; e
' j, N: j6 M1 C9 f) c; H[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 4 L( w- ~* j' O0 I

: w# g- L2 _9 x2 ~N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 6 _; N1 X  }# B
* y/ _3 H" [9 ^; V, e
'{$ElementUpgrade}', '{$ItemPierce}');");! x7 e* _. F" P+ Z! ]
}/ T1 N, X" @: [7 Z! z7 G( y

+ R* a: p  q) Z8 N  `. o+ c/ B}
' J: `- s+ J- _5 m5 Z. N) R) `- p8 P. c4 l6 N. e
}
/ M) `. v7 i/ R6 ^  D3 [! N* [( \
$InitForm = InitForm();
; V, ?9 J% c6 e1 v$Listener = PostListener();
$ `" a) j+ F* C  v$ i# U7 l7 C
) \6 T; k' G, ~5 Z" C1 y, r- r?>
" D7 Z! |  g7 M. X2 t3 h/ t* r# _+ `) m  H9 \  l

" r5 b' J7 X8 K, w* h5 y5 {" x) Q) P; R. L  T, V( w

0 }& \, k4 J8 C- S
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-27 23:38 , Processed in 0.069305 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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