飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
; t, }7 ]! z& U- |  ?  y! Lfunction Connect () {
3 O  {7 s# l/ r! cmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
6 K7 G4 H1 [5 Y. ]6 g2 D3 }: K% m! f. Z+ V
Failed.');
) P3 E2 J( v) h7 Z& `8 h}+ U8 T* M$ O1 J4 w
Connect();- T/ Q1 _; G4 N( B8 _
) s: r9 o# g8 y- W
function InitForm(){
# D. f$ {( s. s9 z- C4 o//layout for the form1 P2 X: q. b" f
echo "<strong>Send Items.</strong>
' r6 g4 M- H) Q/ h, \<form name='select' method='post'>
9 m9 m4 E+ h* L$ i8 `<lable>Character Name</lable><br/>% S- E1 _3 q2 m' d9 w
<input type='text' name='char'/><br/>
# ]! Z: R3 C- `) h4 Y<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>$ Y$ L+ d; U: H; }) \+ @2 @) R" g
<input type='text' name='item_name'/><br/>
* Z+ ?+ {" y# b$ O3 @<lable>Item Amount</lable><br/>
' y1 k1 N0 Z4 h' ^  @- [' {- C<input type='text' name='item_amount'/><br/>/ f# D8 Y4 t; n# p
<lable>Item Upgrade Amount</lable><br/>, W+ i0 o9 @0 p
<input type='text' name='item_upgrade'/><br/>
0 k- Q4 e: i. U  ^<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.): K6 C9 o4 P$ ~: z- W8 A7 {% f
" \0 n' U6 A1 R) _6 d9 {$ e
</lable><br/>
2 |8 n! y- ?7 [' K2 y5 ~<input type='text' name='item_element'/><br/>* a1 z7 n+ d, S2 G7 B
<lable>Element Upgrade Amount</lable><br/>' x4 J/ q: s  o( ^3 [6 L: M, V
<input type='text' name='element_upgrade'/><br/>
+ _, m( R1 `$ l# x% Z( w. S<lable>Pierced Amount</lable><br/>
# L# o/ e1 i) i<input type='text' name='item_pierce'/><br/>
' _& }+ I7 [# c9 j$ p- |<input type='submit'/>
' y# i- _1 _: F4 B$ u' j& E+ u- Y</form>";
2 j  X/ \# h! `& x}
1 [5 a" z2 X; K: q- `% a" X& g& a* Y8 B9 M1 Z
function PostListener (){
" ?( D3 z5 P" U" n: m: i1 `//Add more post variables if needed and add them to initform() function aswell  @! ^8 l, t, T- `

5 G1 H- b7 f% c8 z+ y6 x################################
* k2 u3 D4 J; H/ H$ u1 ]##### Connection and Post ######+ j8 }& d" R% X7 p  E" [
################################7 @" t8 X$ z% v5 I$ n& C
$name = @$_POST['char'];
+ S5 B' c/ u# z- K$ItemName = @$_POST['item_name'];. r( e1 }) P: f* P# `" g5 q, q
$ItemAmount = @$_POST['item_amount'];
* |% ]. v" T% |8 ^# @+ ~& t$ItemId = @$_POST['item_id'];
# K; F) K8 w" \  g6 L, k$ItemUpgrade = @$_POST['item_upgrade'];
" g; Y/ G4 N# }& _! m% c# X$ItemElement = @$_POST['item_element'];
8 t$ X* h4 M5 _) [$ElementUpgrade = @$_POST['element_upgrade'];4 w: c; h) y0 j: X! d, F
$ItemPierce = @$_POST['item_pierce'];
" q7 E5 y9 ~- l! r; u5 R" k################################
# l0 z0 {; T5 [" D. X: H6 u% g4 H+ g8 F$ S7 w; w
//Check both variables for empty value! Z3 y( K+ T" s. c
; M9 J! a$ I& B
if (!empty($_POST['char'])){
6 Y: n6 U5 M" s- e7 Z. |" w$ K3 |* V! l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ( k, S. @" Z$ z. z- x3 Y+ r
, ]: G" V6 o. E1 Z; F
m_szName = '{$name}'");
4 ^' V" k0 \4 Y7 p$ J7 wwhile ($row = mssql_fetch_object($find)){- P; R) k: A+ P; o! `# E
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";5 H+ X" s) u: r# B
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
/ @- U# N  O6 p- R9 D2 x( z7 M* w# }- U) D4 I
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ; K) Q* J4 I2 O

" l5 Z) z5 }! ?* J4 L3 D# W[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
& f7 [9 h# E- S" J3 n6 T
/ |5 A+ L$ q0 G  L8 w% N) P% w2 y% g4 uN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', " a" w! {1 I4 E. y. _3 g5 h

, _+ d$ Y3 ]+ T& g# f3 c'{$ElementUpgrade}', '{$ItemPierce}');");9 x: Y6 g6 l5 S; _
}
* T+ k& G9 S1 V) q1 b( U4 r! @2 X# ]
}
! x7 H2 }* |: m! }* b/ O, c, W7 F, B2 M) X% B
}! h) U! a7 k- X( F

# g* ~8 |, @+ v$InitForm = InitForm();
' @8 `2 T8 D' a/ L9 c  R$Listener = PostListener();
6 E" O+ X2 R4 q: m- u5 S" N7 ^& m5 [* o+ U' y5 [4 d0 t
?>
$ \2 l# Z+ N8 t3 l+ D  J4 d3 M) d, I) @4 T

* d* N# e% C+ R8 }2 @$ M4 Y5 U( @
9 M+ c; B. x7 {' o+ R/ P
( m  P% e  {% i. ~7 Z
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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