飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
8 B+ f7 A1 N3 ^$ [! ufunction Connect () {
; U9 ]3 x( M" Z: }2 L( gmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
5 f8 S8 c. t7 I( j' `, e- @  S& V0 d# Z3 N+ U% N
Failed.');
& [* f4 z# L* `8 X* ^- k}: a8 F9 V: q/ D6 f
Connect();% X6 v9 [* \! r1 d

3 B: v' F: ~: Ufunction InitForm(){
" P9 C* u% {( b. ?//layout for the form
5 b; r. u8 @  N& Aecho "<strong>Send Items.</strong>- K8 J8 T; S' ^- U$ ^0 k( [" Y
<form name='select' method='post'>
+ ~$ V( i8 Z* A<lable>Character Name</lable><br/>
  b4 x: ~. p( [* |( s7 ^6 Z8 P<input type='text' name='char'/><br/>8 l4 y. Y# P- K6 c
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
  k  I: v+ y7 c9 n, w3 k/ M<input type='text' name='item_name'/><br/>
) W) Q" P. B) F0 w<lable>Item Amount</lable><br/>9 ^) I  V. ^. u) }3 `& L
<input type='text' name='item_amount'/><br/>
4 c" ^1 k1 s. L! T6 R+ D6 |<lable>Item Upgrade Amount</lable><br/>
. T% }" @4 V9 L$ _, K<input type='text' name='item_upgrade'/><br/>2 S$ x0 u& w! {6 l  S6 @& t4 A8 T
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)4 Q! S- \- ]) _4 B/ V, y7 X- B
* F: m; ~. T: P7 C; \3 |) q
</lable><br/>! o/ F6 C+ x3 @9 e
<input type='text' name='item_element'/><br/>2 u2 g& K: N; ?- i8 N7 A. b1 R: o
<lable>Element Upgrade Amount</lable><br/>
! W9 a8 S4 g& n- Q) V! I' U5 P/ p<input type='text' name='element_upgrade'/><br/>4 b% E; {" i0 d6 r& _
<lable>Pierced Amount</lable><br/>
# p% \9 ~, S* c<input type='text' name='item_pierce'/><br/>
4 E  y0 d* J! z# Z<input type='submit'/>( Z+ C: U8 P7 m. L* V  P) t2 S7 }
</form>";$ F" Z7 w: A2 V5 K# H4 ?
}4 }( w4 ]' d+ H! `  q5 V- k. ?5 q

4 `. Z- E5 D! n" zfunction PostListener (){
$ B5 W0 s& V& [4 U//Add more post variables if needed and add them to initform() function aswell
3 [' h- x( |4 W
; I# L9 Y5 e7 \8 k7 Y2 Z9 N7 L6 P################################6 f( F) P; }6 M( H
##### Connection and Post ######0 f6 ?7 a- w0 I- g% N
################################$ [4 X6 H* E8 k
$name = @$_POST['char'];
# h1 g/ [, k* a, V$ItemName = @$_POST['item_name'];
. p. @/ `! n% o* a$ItemAmount = @$_POST['item_amount'];3 ?! t, W6 X# f
$ItemId = @$_POST['item_id'];
8 k5 H$ C' M+ ^. \2 l/ Z0 ~3 V' [8 P$ItemUpgrade = @$_POST['item_upgrade'];
2 m- ~, |4 ^) g# I$ItemElement = @$_POST['item_element'];
, ?: ~# f4 `4 i4 _3 ~6 E$ElementUpgrade = @$_POST['element_upgrade'];" h( S9 Y' K2 G. y/ F
$ItemPierce = @$_POST['item_pierce'];
  p1 M/ x3 n& _4 f+ }3 Q2 J################################5 x: H7 i: f7 O! i8 D
$ o4 [2 ?- D1 h) q% a
//Check both variables for empty value0 `. o; b: P/ s7 _' c9 o
* j$ p+ |5 b% }) Z( e9 \- ?; T' ~
if (!empty($_POST['char'])){4 r% c: [2 y6 d
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 Y8 D; ~0 v+ e& j% i3 Z" i

, v- p) b/ W% L6 Y8 U8 tm_szName = '{$name}'");
$ j6 X9 s! d& x- E( f8 H- hwhile ($row = mssql_fetch_object($find)){
% l2 N8 X1 v  P0 becho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";/ @7 x5 F! S- G
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 0 n* C! {- F3 Y5 ^2 Y. M$ t0 m0 [

  q+ Q  L' f* @6 K+ [2 M* F[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], # ~8 c: d$ T3 s9 q' D3 t4 I

8 C9 B8 Z* r: r) e( b. @[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 1 _- Y% s" j, I

8 a! N( g/ i4 B3 M" Z, \: _- C4 uN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
( o: @5 F8 \6 d+ k1 }5 [2 L9 x8 N
( a: ?+ B$ X. j* _'{$ElementUpgrade}', '{$ItemPierce}');");" M( T4 k6 Y7 K5 ~. t0 Z7 A
}# V& @2 ~/ S: y8 Y$ r
3 U; r! N' V* K3 g3 }
}
  b+ Y4 Y  J) g; y- R: J% u* K5 X, H; U
}
" d. ^8 b+ s- K! u2 t- S
  E4 g2 v( O& W  [+ H: i( P$InitForm = InitForm();
1 q; X& n' G/ h7 x( O/ Z$Listener = PostListener();" I# |" H% X" }. v

& j" F# Y5 R0 A' w3 j2 y; y?>
3 R, j2 D! B% Y" ?, Q% f  A
) q) E; i  T4 X. d: J2 e/ k+ p( \8 t

" s" j' P+ r: m3 K( X
; f+ B$ u! i" \" b+ U
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-11 23:56 , Processed in 0.069287 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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