飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php- x/ t9 L" o, }) w! C  d  U
function Connect () {$ N  ?' ~+ ?# p% k
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 2 @# F/ ?) b9 n

& n: A0 i4 {4 [' W5 |" RFailed.');4 C$ q5 w. M; A* O3 w; I/ |( G: X: w
}" c0 v( ~# E' s9 n
Connect();# u+ e* q( E! I$ M" Q% K
2 I2 L5 v$ O. t# c0 P7 e3 {* r* {
function InitForm(){5 n' @: E+ I7 M# R* C% G7 g
//layout for the form
3 x9 O: y7 T. t) `* ]echo "<strong>Send Items.</strong>6 d8 L: M4 r( F! D; g9 }
<form name='select' method='post'>
; F! d8 c" a& d' q6 z0 [<lable>Character Name</lable><br/>
/ I0 s! |! G$ y<input type='text' name='char'/><br/>
% o( y# U4 x0 b& h: G<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
. U/ k( t; h1 N. l3 c6 D<input type='text' name='item_name'/><br/>  @: ~1 E; c& B$ w, W: p$ Q
<lable>Item Amount</lable><br/>
/ L' ]# e7 R( b5 W<input type='text' name='item_amount'/><br/>9 E& J: A. t7 A" _$ x( c$ ~
<lable>Item Upgrade Amount</lable><br/>
. C, k/ Z5 ~9 T<input type='text' name='item_upgrade'/><br/>% g: J; R$ _( i0 N7 y2 R3 o; }
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
: W' _# }" \1 S' S; Q2 y9 x0 D( @$ y) Q1 g. d/ D- [# I3 `
</lable><br/>
+ h( M& @: u5 l<input type='text' name='item_element'/><br/>
4 A. V4 s0 y0 I' b8 R6 r9 k2 c) o<lable>Element Upgrade Amount</lable><br/>
& P/ |' f' P/ A<input type='text' name='element_upgrade'/><br/>, C! f3 s9 a, z$ Q8 X/ L; F- W' A
<lable>Pierced Amount</lable><br/>, r% H8 _6 U0 i  X. @+ @; F
<input type='text' name='item_pierce'/><br/># c3 V( D  b/ f$ r9 F( `! I
<input type='submit'/>" f& y& `5 k! u' P# i; Y3 A0 r
</form>";
; w6 e6 `1 B! n2 F  M}
6 ^- u# Y3 C, N
6 m: e. d$ O3 n& bfunction PostListener (){( O; E4 d. l1 r) V
//Add more post variables if needed and add them to initform() function aswell6 B2 S: M0 M9 c! Q
" h# v3 P6 z0 J. J  d- M& z% C4 _
################################
9 v3 j$ q3 U! P- [. @) F##### Connection and Post ######" k  G8 Y( v) w2 i, v# Y6 D
################################
, t# y$ o" D: }% B( ?" H" e$name = @$_POST['char'];3 p7 m: q8 V' e5 b3 K, n' x$ w! O
$ItemName = @$_POST['item_name'];4 X& s% B- P: _2 N% L& j# \
$ItemAmount = @$_POST['item_amount'];
' i2 E% y( Q9 M9 A; K1 C2 C$ Y0 h$ItemId = @$_POST['item_id'];7 \8 `3 q2 l0 l: k  l2 n9 V6 P
$ItemUpgrade = @$_POST['item_upgrade'];6 `& Q5 b! Y. X5 g
$ItemElement = @$_POST['item_element'];
3 K: [. Z4 E- x7 C! [7 B! G6 M' G. D$ElementUpgrade = @$_POST['element_upgrade'];
" G$ t$ u2 L$ I/ G0 Q$ L* N$ItemPierce = @$_POST['item_pierce'];2 f, U0 r3 Z+ a$ L
################################' O4 l1 e" Q! c" p
- f' \' g. H, d6 l% i9 r
//Check both variables for empty value# ?. G" p# t  o, ]* p

8 [1 }9 j9 C0 W& }3 v2 p' bif (!empty($_POST['char'])){5 u% g$ L. U# z8 X9 k
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
: v. I7 S) k2 _& Z3 d. h
4 g5 [3 W! y/ k- Bm_szName = '{$name}'");
0 d( ^, ~& X, `& R2 [0 |while ($row = mssql_fetch_object($find)){3 T; g5 p& q# m" Y/ q3 D) z1 v: f
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: [! f7 ?; H# L$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], - n% s3 C0 p' _7 n

: B8 [: o/ |3 S8 L; Z* l[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
+ j/ \: w; [5 \* G5 J/ j3 y  k4 D4 z1 m  D& }2 T# i* \
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', % u8 Q0 z, f. M9 s% B

" N" F) v9 G) ~3 l# ZN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 2 ?6 _& z5 \% m
. S) l* u/ W( _" H# N& ~/ h6 N# o
'{$ElementUpgrade}', '{$ItemPierce}');");# |8 a) A- k9 c* u) {
}
9 [. Q- Q8 s+ f2 a8 d# Z8 }  b' Q0 d/ f8 X+ G4 G" ~& F: C
}
) a3 m% L% k3 M8 l5 l) f2 V3 _% s5 q' M+ B. w
}$ V6 g; O. o  R: v/ Y2 A
" S8 D1 y# A- Q
$InitForm = InitForm();
  `- [* G, c* ^5 o8 U& C% i! p$Listener = PostListener();
) Y1 ~5 o8 r1 }% E* ]
  c+ Y6 G' j3 x7 d?>
" e1 w9 z. R. X$ i4 h, `* F; v/ j. }' G; C0 |

8 K9 ^; \8 a) q" }, {. ]6 i5 V. g8 \# \5 I. [: X. u3 e6 E

! D0 `) s8 i2 Q2 W8 B5 k4 w
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-8 07:55 , Processed in 0.081528 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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