飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
; E$ \; K& m0 V. T8 t. a3 _2 Jfunction Connect () {
0 u" o8 T- q; R. O! }- imssql_connect('Server','UserName','Password') or die('Error: Connection to DB : J% S. r3 P' V$ V
' g$ a) m2 C" a9 I$ }: d
Failed.');/ G9 F" Q! B0 n3 \: h) {. |
}. J) ?. s$ W+ I
Connect();
1 L7 H8 W: w" X( v6 G3 K7 v+ E6 l) Y. ?/ i8 I* U9 c
function InitForm(){
% n6 x. o% g0 |8 e8 h; b+ G//layout for the form
5 j$ N2 k, N4 d  F: W6 u, yecho "<strong>Send Items.</strong>. R) A: X  G# P" s- O1 c
<form name='select' method='post'>0 B. G4 w% o% l
<lable>Character Name</lable><br/>9 m6 t+ s$ c; ^6 K$ _
<input type='text' name='char'/><br/>
! K- G0 a) Y3 `$ E( M<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>/ D7 p/ I/ w( `9 q/ \
<input type='text' name='item_name'/><br/>
2 d6 i5 `) T9 Q9 g6 W<lable>Item Amount</lable><br/>
4 f+ G/ T8 S6 r0 h. k, U) s<input type='text' name='item_amount'/><br/>- P: s% C- m7 ?8 y( ]4 o! \
<lable>Item Upgrade Amount</lable><br/>: K7 @# E& `. q& @( Q6 t3 n
<input type='text' name='item_upgrade'/><br/>3 X/ g* O) q" b$ k3 v" Z) P
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
+ N, D$ N+ S% K5 C3 ?4 P2 v- [; T1 }
</lable><br/>+ ~: c7 P0 z; Z
<input type='text' name='item_element'/><br/>+ c  ^$ E: W. ^$ M) i4 x
<lable>Element Upgrade Amount</lable><br/>/ O, {: F! I, T& a4 c
<input type='text' name='element_upgrade'/><br/># `: b) a; R: w
<lable>Pierced Amount</lable><br/>
* O5 ^2 ]; L$ \5 f$ }<input type='text' name='item_pierce'/><br/>
5 ^0 ^8 C" f1 p<input type='submit'/>
9 k8 M: X# Q1 P! C9 z6 L</form>";) G( D- Y: b( A7 p) t
}; N4 ^& Y: O% b
$ O0 @2 @3 l; I% K6 Q7 V
function PostListener (){
$ [* C9 N- s' F8 T2 x2 R//Add more post variables if needed and add them to initform() function aswell
: ?* ~. P5 T& U
( I6 h/ I* P9 V$ y& Q# O################################4 w$ Y4 J/ {, L9 L  y5 s1 m, X& W' j
##### Connection and Post ######
( z. m# N) O) T) @################################. b. p+ J, C: Q+ y3 h" h; S* c! O9 w
$name = @$_POST['char'];5 [2 x' L5 z: c; u- W3 V" h
$ItemName = @$_POST['item_name'];' f* y5 R0 g  E7 O7 y
$ItemAmount = @$_POST['item_amount'];! }  g9 a, z+ q5 N% C  S
$ItemId = @$_POST['item_id'];5 M- ?# w) G0 v1 a
$ItemUpgrade = @$_POST['item_upgrade'];
6 ?) z+ m9 [( L$ItemElement = @$_POST['item_element'];! D5 _2 `' x! O% @
$ElementUpgrade = @$_POST['element_upgrade'];, T3 |) u; w1 y
$ItemPierce = @$_POST['item_pierce'];
" N  Z- k6 O* |6 n; c5 I. Q+ }################################8 }1 C. G5 V4 B2 e

9 p, A. {6 s. X/ G1 ~. U//Check both variables for empty value6 o3 {6 _! u  _9 w4 t* }

/ ~/ ?  F! o5 g1 a6 X' X: ?# w$ pif (!empty($_POST['char'])){( O6 ~6 ]$ s2 M4 y1 T
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 N6 ]% _5 K5 u7 j& O, _0 D

- G0 p6 `5 g- \/ d- r2 V: z* U* I1 qm_szName = '{$name}'");% O( g/ z, Y* a4 S" A
while ($row = mssql_fetch_object($find)){% Z- r8 D) X5 X/ b! J* {2 ]7 y( M
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% {7 n' c$ K6 G/ }% ]# a( j
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
* O; I! X; \: t* h
+ R; W5 O! `5 i- V; [  Z- o6 ?( Q, T[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
( J2 h; v5 @; `4 h: ~- z3 m& c8 x# G. `6 P% _4 v2 R' ]0 U
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : [" z+ V0 a1 ^- r! X# H. e

# e) ^* [+ ?! _) f$ Q: I/ C- C, iN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
* G2 f* S- L0 k
8 U( b% g' U7 ?'{$ElementUpgrade}', '{$ItemPierce}');");
) N9 [  {1 B( B1 e7 Y}; s7 f8 |' P+ w/ F. Y; D9 N; i

9 |0 B0 ?/ i, u0 D8 l% H+ J' q}
8 {- [# O. S% q$ ?4 U& w
2 x) x4 r7 W" J. L}7 d# ^  H8 H: O2 A( D
3 e9 A$ n; H* V2 T; b7 ^
$InitForm = InitForm();
" s" H/ B( `+ S+ Q0 ^$Listener = PostListener();
9 [: b& n4 f1 \' t  y/ Z% C) ]& w. F' O( }3 U# c
?>
. W- I" ]3 ?# }, r, e1 X, I, ]# }7 m0 m

! P: u$ V2 f6 k8 Y1 H
8 L$ \+ A5 G: p1 {" _5 t/ x0 A. w7 }6 l+ \5 ]4 i
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-19 14:47 , Processed in 0.070027 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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