飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1092

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1092
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php, I, X) {5 U! B9 e. K3 d
function Connect () {4 S% V4 |+ L, \
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
+ b  ~) h2 J! e6 ]5 r! w
' X: b- L) L4 }. G% g6 z6 J) kFailed.');+ I: u* U) `. v* O! z5 P
}  z! w, v  U0 @0 Y1 c- N
Connect();
& j+ P& \; Z- \+ Z7 E" a4 ]" j- _7 D, R* ^8 b# C" `: ]8 o
function InitForm(){5 h. q5 U( v; ?, O
//layout for the form$ O, x# I: V2 o. F5 m
echo "<strong>Send Items.</strong># z* u$ V$ [- E2 @! T. @$ ?, T2 {' L
<form name='select' method='post'>0 k6 f, ?% j( Z! @
<lable>Character Name</lable><br/>
' f5 N1 T, v) k3 _<input type='text' name='char'/><br/>" f7 g4 ]& w$ w) D3 o6 ]6 {
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>, |0 B. M' w: z$ N' [
<input type='text' name='item_name'/><br/>3 K  X4 ~/ b1 P- e, a8 t
<lable>Item Amount</lable><br/># _6 c, a0 V, \9 [& B  F, s5 ~0 i
<input type='text' name='item_amount'/><br/>
6 b- R7 m1 z1 o9 U2 x<lable>Item Upgrade Amount</lable><br/>3 z0 c3 X$ ?4 A- A9 y! Q# L$ o
<input type='text' name='item_upgrade'/><br/>
) f' w2 V# c2 [3 ~* e) K<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)  d3 J. U3 F- k* m

* j9 x; X- y+ V+ s2 G: ]$ P</lable><br/>
6 i* S- F" O. S# Y9 \<input type='text' name='item_element'/><br/>
2 R/ J4 [$ Y1 x2 ?3 j<lable>Element Upgrade Amount</lable><br/>( A: G$ ~, l6 {1 A
<input type='text' name='element_upgrade'/><br/>' R$ V! m# G) ~5 J9 D; w3 i/ ]
<lable>Pierced Amount</lable><br/>7 t+ l  K3 ]0 _9 `& h  x% [; h
<input type='text' name='item_pierce'/><br/>
$ ]0 ^+ r7 d0 H8 F1 A  H<input type='submit'/>
9 a) ^1 Z8 }  U$ E</form>";
+ @4 k3 ?8 q0 \}
! A( B1 i0 y( ^3 R3 a; h5 a6 ]
function PostListener (){, ~# b, r+ w0 |
//Add more post variables if needed and add them to initform() function aswell
& A. Q0 `- U7 C
& y% l  @9 N8 i################################
4 F2 q/ q; ?# z2 J5 S1 ?##### Connection and Post ######/ T" t0 S9 @1 P3 s- K/ q+ X0 H
################################
* C3 v" ?  d( d1 C0 ~. j% x  e' _$name = @$_POST['char'];
4 T5 w5 ]% B: H& u! C$ItemName = @$_POST['item_name'];
% h% Y! A( r" H8 v* k$ItemAmount = @$_POST['item_amount'];) r1 k% U2 F: _7 g
$ItemId = @$_POST['item_id'];
2 m  f+ G2 _  N# X; f6 |$ V+ B$ItemUpgrade = @$_POST['item_upgrade'];
: r) v, E5 V0 h4 M$ItemElement = @$_POST['item_element'];
: ]9 ?2 f6 c6 `" q! B: U$ElementUpgrade = @$_POST['element_upgrade'];/ u: s- j6 t5 P; q0 t' I* z. Z
$ItemPierce = @$_POST['item_pierce'];% B7 N' M% c) v( A
################################
9 u7 M, I) i' x' L3 {+ K' {- C- g  k3 ^, u, I( t: f- S5 @, M
//Check both variables for empty value
* e- [( Z2 ]" B' V3 ~- |" q. j# o6 _6 r# |- B
if (!empty($_POST['char'])){
; K  G$ w' x: M2 K/ Z( j" w: \' ^$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
" `( L6 x/ i1 @6 B# H/ d! b; ]  ^1 _/ O% z+ U" |4 J) ~
m_szName = '{$name}'");
3 g; S+ x  P% c  r& z: {# Awhile ($row = mssql_fetch_object($find)){
6 M: ], g# O# k0 D0 s9 D4 iecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";* W# @$ i( D! I% A3 U- W
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
0 `4 B; J  s) k/ P8 f! Q# P
8 c9 J/ k& N$ ^6 g) [3 c[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
/ ?% F! O3 l; ]" |. R0 ?0 d$ L: e8 q( ~
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
' ~% Q$ h0 A0 T9 L% h
: T. y1 `8 |/ W- tN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
9 h9 W7 T  Z7 |- ]% z* N- E% i# a: o. `5 m/ g( D* H
'{$ElementUpgrade}', '{$ItemPierce}');");
- h. h3 ]% W. S' R}3 u! d& `1 m: m6 o
) Q& ^% Q+ M( I7 G
}
+ p0 Y" o- g% m9 {! c% ?5 M, `" d2 N- x% D8 l3 y
}$ r+ z. X0 ~$ e, b) O4 [$ k

  Q5 h9 G+ w1 h4 J$InitForm = InitForm();
" N! D; U, q! f3 \7 w+ ?+ t" D$Listener = PostListener();$ [; `" h  K  q8 v

  m' V  ^+ o- @) a; w* @2 K, e?>! v% {" e2 j6 T5 G0 G% B+ l

0 R; P7 B" e( A+ U: x
- I- A7 x5 l* W; u$ Z$ R1 @2 e% M# L2 r% X6 q& S+ b5 C

6 D& r$ b0 q7 a6 k
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-29 05:06 , Processed in 0.068138 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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