飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php* b* E7 t; l. c. U! c0 f1 ~
function Connect () {
1 J" K# u& y% ~; smssql_connect('Server','UserName','Password') or die('Error: Connection to DB 7 J$ w2 p9 Q3 }+ D9 e' P

4 g* q8 M5 \% ]4 f1 g+ d; RFailed.');) V: ~& G& e1 ^0 i, k* H* }
}
" P9 P: u" W9 j, r& K$ _Connect();( M" g- w1 m3 L: n% y1 t" h

5 |: l2 \1 p3 X( K4 ofunction InitForm(){
& W, P. W) j) s% M3 ]6 U//layout for the form1 \% ]/ ?- E0 P
echo "<strong>Send Items.</strong>
" C9 o+ y1 e1 Q) N) @  C5 B<form name='select' method='post'>
) Y! ^/ A8 k! h& i2 x) [8 T<lable>Character Name</lable><br/>. Z/ _. E/ s( ~4 J, K! Y! N
<input type='text' name='char'/><br/>; ?  a' x# Y- X3 _
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 \5 h) M5 L/ n1 h' m2 ~
<input type='text' name='item_name'/><br/>/ {3 g/ t0 m% e
<lable>Item Amount</lable><br/>
$ H$ ]6 T; |4 ^. A<input type='text' name='item_amount'/><br/>2 B4 z% j4 y! a! G+ j( T
<lable>Item Upgrade Amount</lable><br/>
7 ^5 `- Y0 |* i! ?0 S& C<input type='text' name='item_upgrade'/><br/># p5 ~; t. r- q; O5 W1 H
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
2 B8 ^0 F) h4 R" V
  w; U* {! f: T% A</lable><br/>
& Y, U4 j& {0 z- N+ g<input type='text' name='item_element'/><br/>7 \5 C/ {/ F6 l5 f5 {
<lable>Element Upgrade Amount</lable><br/>
, [: ~+ v. E+ D<input type='text' name='element_upgrade'/><br/>
+ e- c# m$ l2 X% _<lable>Pierced Amount</lable><br/>
$ N% x- E9 _9 L7 n4 r8 w0 I2 u2 i. _<input type='text' name='item_pierce'/><br/>( @' H# g6 e4 s
<input type='submit'/>
7 h5 F1 i3 v1 ]) ?" f2 b' u2 C</form>";
0 D. q; _0 X* J& o( H}
4 q  p& l6 H* P8 C# K" a8 R, d. y: s3 }6 ?- G( \9 [: V. q8 o
function PostListener (){# D" t  b8 ]8 p0 e& Y
//Add more post variables if needed and add them to initform() function aswell$ }' U  c- E* g. C$ a& F4 S
/ S, t- t  n  _! A* c* p- Q: R- J+ V7 \
################################
. L2 o9 ~, q- ]0 X. }8 [##### Connection and Post ######3 i' P/ F: A/ v1 N( S2 Z
################################+ o! x4 T5 t7 i; @& O- x2 s9 g
$name = @$_POST['char'];
" j: l$ Z8 S  Z) y# e) x8 X$ItemName = @$_POST['item_name'];
# @3 {4 _; `/ V$ItemAmount = @$_POST['item_amount'];
) K7 d2 ^- J4 Y4 c' y/ l# A5 l. O$ItemId = @$_POST['item_id'];
# w8 H  ~1 f% Y$ItemUpgrade = @$_POST['item_upgrade'];
! f4 B9 \& O; O: ^$ItemElement = @$_POST['item_element'];
" M. P$ m) q, {# Z8 \$ElementUpgrade = @$_POST['element_upgrade'];5 ^7 Y  f& k9 |' S; N
$ItemPierce = @$_POST['item_pierce'];
) G' z% _4 g2 N$ G( V. `9 Y################################
9 D$ |6 @8 @6 w$ X# K% ^+ o( [/ F  `# i, S0 s' P2 G" F
//Check both variables for empty value8 z3 g5 x" h: ^9 c

- _1 G1 [7 i% V! |$ y# kif (!empty($_POST['char'])){3 C  {3 G0 Y- ~) J, r5 H! J
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 U0 J) k* @  o+ |6 k5 ], Q0 N# o% ]: ^( ^
m_szName = '{$name}'");9 F+ H; S" S4 H6 Y9 S* Z' r; h0 Y  N
while ($row = mssql_fetch_object($find)){4 a! z/ d, g$ |4 [' l! Y9 H4 K
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";4 E- J, ~) B# H6 U
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], , C1 L3 m2 k4 ~

4 I5 `* |8 x, X; A$ k3 x[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ; y, w6 P0 Q( M
7 r" J1 n7 h% S+ t0 T( ^
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
. M6 h: G9 i. I! n* {$ c. C  s
( O' y4 s- l5 }/ f) l9 f7 N1 L7 E5 DN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
4 w9 r) C3 G2 C+ f; n! s" p2 d( i6 }: p
'{$ElementUpgrade}', '{$ItemPierce}');");3 }: `+ @3 z* I. K9 K+ `7 s7 ]
}. A# s6 d1 y7 Q, {2 Q

  s0 T) e7 v7 d# b  l}+ B0 R: j5 Q% U! r3 b2 K
+ R" \  h, Z6 y
}
$ t) [2 e9 V. g( I8 c# ]
  a; k& T! Z1 a, l% s$InitForm = InitForm();1 y/ H3 x  r3 T# W& {# g' H
$Listener = PostListener();% K! i9 V9 B; L9 M7 a* z

4 r- @4 Q  `9 |3 i- I% W1 M1 w?>
8 ^8 u  H& W. P7 ]
: Z/ u* ]6 K, h. G$ {- E. N0 W( a& C5 ~3 Z  j9 `$ v5 C
* B& R+ S6 n6 b7 O# M& r( F, v
2 c) u& Q' y3 i: A+ l. k/ l  i4 C
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-4 12:54 , Processed in 0.099594 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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