飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php' _" c' D" l/ ^9 U0 W, L7 ^
function Connect () {
; w3 {/ o$ w4 u( m5 v$ Nmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 0 q0 i0 A9 v! T  T* m% F- @* t
8 h9 g! M- k" B( N. ^
Failed.');
0 c: k* s4 Z" S, W: S! S3 \% l}
, Q5 g! x. H% W  o* |' iConnect();
7 ^: y6 y: ~2 d1 a  M9 e1 j. ?  B2 z* j. f: u& M. z9 ^
function InitForm(){, J3 E0 q* e% |. U
//layout for the form
+ [) ]8 ^/ Q7 e) Xecho "<strong>Send Items.</strong>
. N( M- `0 ~4 Z: X- f<form name='select' method='post'>! n" X3 t# \6 |
<lable>Character Name</lable><br/>
+ X7 A5 x+ e& G5 b( g2 K, h7 ^<input type='text' name='char'/><br/>
$ ~, @0 }1 r. o/ j( c<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 ^$ a2 m( [3 \
<input type='text' name='item_name'/><br/>
  G- Q- V9 d+ a: W1 l7 e<lable>Item Amount</lable><br/>
7 q8 ^7 |  _6 T1 q6 z) {2 A% i<input type='text' name='item_amount'/><br/>
: F# d* \8 o* y. U8 ^<lable>Item Upgrade Amount</lable><br/>/ U" j& r) D' m3 d; [
<input type='text' name='item_upgrade'/><br/>
0 e$ W/ K6 B! z% U3 R! u<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)" f/ o$ b! `$ u/ ~9 P2 w& A* a

6 D1 F' ^9 q  F' g0 |9 _! p: a# N9 i</lable><br/>+ I8 i: @/ O" }( L
<input type='text' name='item_element'/><br/>
& b# l  t# @9 o/ }7 ], ~! C<lable>Element Upgrade Amount</lable><br/>
( U3 P' T- x+ M; O+ ^<input type='text' name='element_upgrade'/><br/>" C8 y& P1 `1 [4 c- b! |1 q: H
<lable>Pierced Amount</lable><br/>: ?* x) V& \! Y! ^
<input type='text' name='item_pierce'/><br/>8 Y7 ~) L4 |! ~! D# P
<input type='submit'/>6 `1 I& G" c; V
</form>";
8 M4 t0 i8 O, I' K}+ n7 L8 s- L# V* t  }4 k+ [1 c
, s* F% [0 r$ v! j% x3 [! f
function PostListener (){! n* [' E9 t; q4 G( @- ~
//Add more post variables if needed and add them to initform() function aswell% E8 p) F; R& G7 K3 _; e0 c

, X8 O- M* z, ^  H################################( L5 K. W# ?/ T" p% w
##### Connection and Post ######" ~/ d4 F. i8 a; Y; G- o- Z7 \8 ^
################################
  z, _/ T) _# }) _$name = @$_POST['char'];
7 u5 k3 z# N: N5 g4 b$ItemName = @$_POST['item_name'];
* W9 ~3 U! G! V$ f9 a* \9 K* X$ItemAmount = @$_POST['item_amount'];" d/ b1 C$ o! N4 q$ |
$ItemId = @$_POST['item_id'];5 R' r# R: y4 A6 J* ?0 }
$ItemUpgrade = @$_POST['item_upgrade'];( U6 \9 o$ v% ?2 k, G
$ItemElement = @$_POST['item_element'];$ [6 _( s1 I2 L/ ^# {
$ElementUpgrade = @$_POST['element_upgrade'];
# X; @8 U4 z# l* P+ U  v, S$ItemPierce = @$_POST['item_pierce'];" {1 H/ O2 {. w! }+ D: j
################################
' t* Y; E* f$ E+ n: f# `. L8 p
) u8 l( B7 Q3 U5 |2 H5 h//Check both variables for empty value: t4 ?2 b8 o9 S: E9 v8 K# Y( a- y

  g" X' ~' |) w* rif (!empty($_POST['char'])){; k! n: N" D0 E6 r$ G7 b
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
# Y* i  n6 [- Y4 P% @) ]9 q4 u4 |% o* q9 r; R3 |4 R7 i) x
m_szName = '{$name}'");7 X* k. s6 x" y- t' e# S
while ($row = mssql_fetch_object($find)){) q& p2 D$ K* E( u9 p
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
  ?6 z" v, E% }9 p& D$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 5 [* n9 \' ~- ]& j. D

! Q. Z9 [) j  n! J! p3 \) D7 D[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 7 I5 T1 G8 K1 w& I

+ a" f$ Q, s  J) R$ B( T[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 2 U; G6 m& m! j4 U
8 x, A$ k6 Z" @+ `+ w8 L& J5 b
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 8 x1 v9 [$ B; n: q9 v

: C1 J; F, T& x8 m4 j  ^) P! f'{$ElementUpgrade}', '{$ItemPierce}');");2 k6 k, ?/ A  \1 g6 R! B. I4 }  e7 N
}
( b% g: M* K( f" X2 S
2 b  N3 w+ K) G$ m6 c( Z+ J}
/ B$ v# R0 L7 E- l2 F( J8 e$ [1 Z5 w) s
}6 V- o3 N: r. D  N3 I0 ~
# ?$ n4 I  _' d5 f
$InitForm = InitForm();
6 }0 _1 ^- M" B$Listener = PostListener();
3 X7 K7 J; i1 q4 M7 \+ O- j- F9 Q0 G1 K2 }  L
?>
: M* G* }& J$ u' n9 ~+ K7 C7 a+ ^& x% M7 |
0 L; V. f( t9 H2 _$ K1 ]9 K

; Y1 X8 |3 }! D5 b6 G; r: u! W& l1 L! Q, A/ C, U7 K: i
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-5 04:58 , Processed in 0.064177 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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