飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1092

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1092
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php% Y7 q# T/ i6 `2 j
function Connect () {; n8 _/ r# ]- l& ?+ S# Q) l
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
: t0 A8 _. E: o( s0 [2 ?7 Y2 ?7 y
Failed.');
) ^) o0 a8 ]3 E}
( F) v/ {) g: ~& E' z) @' TConnect();
$ O% J" J, N# E
2 t) M; Y& O' tfunction InitForm(){9 z- Z5 M. j+ _& }- b# [6 j
//layout for the form
$ J6 m; w8 h3 o# M5 b% n3 b. l  hecho "<strong>Send Items.</strong>3 h% k9 c/ G" C3 o
<form name='select' method='post'>
1 h6 F, V. I* K) q<lable>Character Name</lable><br/>* R$ ~) H/ F7 Z. q. ]* E
<input type='text' name='char'/><br/>
- o7 m9 |- o' |% V<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>% I* F! C5 [3 D/ O( W# B) f+ l( F/ G  @
<input type='text' name='item_name'/><br/>/ _! w2 }# K" J; J2 X. S& H$ n$ f
<lable>Item Amount</lable><br/>& Y. ?$ b! W9 R
<input type='text' name='item_amount'/><br/>. J9 y% U/ l- P6 A2 P/ Q
<lable>Item Upgrade Amount</lable><br/>) d. m; c- ~9 e5 _2 c) ?
<input type='text' name='item_upgrade'/><br/>
4 G% I+ z9 W6 V3 s" A1 b4 ~. r, w<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! j% G, D0 F; r

" s5 p& [- r6 L, D. W</lable><br/># J) u& I0 j+ Z! a' {5 P0 ^
<input type='text' name='item_element'/><br/>
$ ?( E! `) V, q( y& e! ^<lable>Element Upgrade Amount</lable><br/>1 j2 q' ]# G- S
<input type='text' name='element_upgrade'/><br/>" ?" q1 u( r5 Z) H7 l& B$ r
<lable>Pierced Amount</lable><br/>1 |4 o0 b, G/ N9 M9 f7 v
<input type='text' name='item_pierce'/><br/>
5 o/ R, b3 d2 m0 z8 k6 r" p<input type='submit'/>
* A4 g0 F5 B$ X1 W( {! k& L2 [% ]& i</form>";1 D: n9 }  o! o# H4 t" W% v2 p
}
" [! B( G4 c. Q" z8 U
/ K8 `( ?& d) h5 U6 E# {) efunction PostListener (){
& l) n, d2 S. J% e' B//Add more post variables if needed and add them to initform() function aswell$ w- x& L8 F+ u" n

9 Z; {- l+ }# L" \6 S################################0 ^5 a9 U! o( \& G  @- m
##### Connection and Post ######
0 q  H: }2 v& F7 k1 X5 L  j  X################################2 U' ?5 ], z- k" f/ |, i1 \
$name = @$_POST['char'];
/ N$ q; R  n8 K) x, y: d  ~+ H$ItemName = @$_POST['item_name'];0 E# S/ [: u; F0 p3 T
$ItemAmount = @$_POST['item_amount'];0 Q/ b4 A8 f8 B0 {! |% z/ A
$ItemId = @$_POST['item_id'];& u8 V, Y# l7 w" H9 x& o& Z
$ItemUpgrade = @$_POST['item_upgrade'];/ ?& L! N" k6 R/ X5 G6 T
$ItemElement = @$_POST['item_element'];
3 ?/ E: x" U9 U/ K* r$ElementUpgrade = @$_POST['element_upgrade'];1 q0 a8 q4 c; i* {$ }. `
$ItemPierce = @$_POST['item_pierce'];3 y0 Y( G( _/ v9 K" V* b
################################$ [: r- V; K9 ?" V
$ r) ]- O$ I8 U, Y& u- g+ i+ F
//Check both variables for empty value
) h+ \/ g* b: ?) v
5 d  x, l' i0 H) t# [- Wif (!empty($_POST['char'])){
. q% e0 n/ ]+ Z: v5 m# G$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where " h1 H0 {9 G5 f! J; d% C( \6 r7 A) u

# q7 u# I. y9 J4 N, {m_szName = '{$name}'");8 U/ ^" R, x6 |# y  G7 U; g
while ($row = mssql_fetch_object($find)){5 p9 C; n5 |1 H. [* |% _- ?2 ~
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";5 y5 N5 C" Y8 {8 X) d) p
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ( I/ B1 ^8 G  w% D; h

; i! i# h) g& ^. {! F! K[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 0 g. Y, O2 R0 V, v! [, |( c) Z& r! z

/ V; ~/ h% s; Y2 z[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 z: ~. f& D% e8 I) w

% O7 N1 q% K8 jN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 9 K$ d7 Q5 k  B' m
9 i* g9 Y( ]% K) F1 }0 p
'{$ElementUpgrade}', '{$ItemPierce}');");! P5 t5 O* _& v5 _" ^' _
}' v0 Q  H3 Z" @; s/ k

2 I7 [0 r  s' n# ~}; T4 O5 M6 L7 e/ ?" E6 h6 M/ D+ |
) l/ |6 |6 ], Y2 Y. M& B% [6 P
}
. _: C6 w+ o* @: K9 _8 R3 ]& d) O  c" [; |  ?/ b. g: f
$InitForm = InitForm();
/ G, g3 d+ `7 W$Listener = PostListener();% a+ o: k2 J3 ^' N8 H# o
3 W9 h- r. @2 ^) ]8 h( {
?>6 p5 L/ A2 y7 W" S' W: [) w
3 M+ s3 W7 N- k' U/ X! M* M  x

4 `+ d- T% W7 \
& S# \0 [' d# f2 `+ @! G! e" d  H
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-30 00:20 , Processed in 0.068497 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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