飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
+ Z  f% I- {' d8 `, ?function Connect () {
" k. X1 [$ h% U  ]3 vmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
( d  K2 a$ m) I
: ?9 d; T  s6 |: Q3 V6 q) k$ GFailed.');
$ T" H0 q9 _6 n: F+ j}- E/ n% E! ?4 w0 b6 y
Connect();
$ k* q( z7 `+ p0 H# i- I" R! R, F
4 H8 \7 E  @/ w; B1 ]% sfunction InitForm(){  }- w. K  M" }
//layout for the form( W/ b' M  F& y  U/ U$ n0 X/ G
echo "<strong>Send Items.</strong>
5 @5 _+ k2 s* _6 K<form name='select' method='post'>3 r0 C' H9 ?. e, L4 R0 I9 G
<lable>Character Name</lable><br/>
: O1 B* _! ^( p! `6 w- x8 v3 a" m1 }<input type='text' name='char'/><br/>5 d* \7 j: e6 u* W$ @; o1 R
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
- V) N5 x) l: E. b4 t: a7 `& v<input type='text' name='item_name'/><br/>- d& ?$ n7 h4 I
<lable>Item Amount</lable><br/>
$ l5 X; b: M" n) E& r<input type='text' name='item_amount'/><br/>
, o4 E% o8 s& q# Z1 X6 F<lable>Item Upgrade Amount</lable><br/>4 w4 @# V) F+ r( X( x
<input type='text' name='item_upgrade'/><br/># X; {; |; l& C* k* w$ h! t
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. P* [4 b  E4 }& y; Z9 n. ]4 b7 q: ~
</lable><br/>) k5 a, h3 @5 j
<input type='text' name='item_element'/><br/>3 C- \( X. U0 O2 ]6 [/ f+ U
<lable>Element Upgrade Amount</lable><br/>6 e) F- S4 ^- Y, `# h
<input type='text' name='element_upgrade'/><br/>% {+ a9 @7 V& B6 y% w9 G9 r$ |
<lable>Pierced Amount</lable><br/>
) |. g% z3 R  B3 A# s& c8 ?<input type='text' name='item_pierce'/><br/>6 n+ w9 y7 ~+ ?/ J, V- h
<input type='submit'/>
& a  ]3 `; P7 a" x9 D8 C* m5 y1 F</form>";
4 {* d& n, }9 ^$ z* v, d}9 R: a! ~# P/ r  j  a% O
5 D4 F& j* `7 n3 {) I
function PostListener (){
# u6 V  ^4 s: X. n$ a3 A//Add more post variables if needed and add them to initform() function aswell
. u+ c# N( e" B' [
( R" P3 [% J' t; B1 t; m* @################################! A1 S8 _7 I) \+ ?# ?- F8 k
##### Connection and Post ######
8 a# z  p- Y. t$ Q" P1 L4 }8 p6 G################################
" b- W5 ~  h0 m& W* H$name = @$_POST['char'];. c# l/ l1 I! e: t2 A, ~
$ItemName = @$_POST['item_name'];: _$ I% M+ x: |) u' \/ I* I
$ItemAmount = @$_POST['item_amount'];
  d1 C  y" G4 Q6 `/ q! E6 L1 `0 \' a$ItemId = @$_POST['item_id'];
' @, j# `9 Z/ a1 W0 Q$ItemUpgrade = @$_POST['item_upgrade'];0 G: ?/ V# f6 r
$ItemElement = @$_POST['item_element'];
7 q, k3 w3 w8 U; I; E* l5 |) j% P/ F$ElementUpgrade = @$_POST['element_upgrade'];6 Y. ?2 R5 c# m0 O& Q$ c
$ItemPierce = @$_POST['item_pierce'];
- Y% [* N6 a% F' f# Z################################0 `1 t: ]2 g: V7 Q

( `( \: Q4 S7 E//Check both variables for empty value0 Y  Y5 f9 o( ^) Z: g

: O$ U$ o+ _  Q' y- @2 s. w) sif (!empty($_POST['char'])){& ~9 V! S3 y# f0 A$ ?$ s3 ~1 M9 e
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where / @- z  q. n6 h
" m* P0 y1 F2 v# g
m_szName = '{$name}'");# @1 }4 ]4 m* @+ [  j, `7 W
while ($row = mssql_fetch_object($find)){+ P& ^" e5 s1 g2 X, d) e: `
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";5 O# A2 B3 H; r4 v
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], : D0 q' I4 s" W6 r6 o

6 i9 |) w$ G3 h; e[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], - N. w" c$ {4 U; z& P1 B2 J) p

! N( Y. D9 \* V3 L/ W6 J3 ~[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
4 }6 Q: m6 Z3 [6 N2 @# O1 V9 L1 J. j9 K( u% S
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 5 [4 @2 C9 s4 f) ~- E8 P" Q
9 N8 V9 i8 ?- e7 g8 b
'{$ElementUpgrade}', '{$ItemPierce}');");
9 V6 Y4 u2 C+ ~8 g; y}
, g" L4 h7 _7 S1 M* h0 G
- J) {+ F) L8 J. u! C% L1 ~}
1 u; L) K6 y  p: j! R4 y5 T* X) M: j* ?9 u" R: F
}9 x5 U, N4 L7 l& ]4 R

; P5 E: F3 G$ Z) F# X4 [) N$InitForm = InitForm();
( C( N: J, l' g. U* D: t$Listener = PostListener();
1 ~) R2 y) P: P% C( o7 p5 \7 g" b/ {  A4 A0 {
?>2 {# j. k: m& Z* f9 i
7 Z- S& X4 Q1 R' |' {- q1 s' h/ ?

0 A5 `, ]* y1 e$ s% N# o# @& m5 x3 g% K9 s0 a* U* }
, P# B, \1 o3 ~0 T) ~1 h* {4 @
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-3 10:12 , Processed in 0.060439 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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