飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php
+ |  |% L4 l& Q% \+ s1 Xfunction Connect () {
' a2 b4 f/ i3 ~7 M. Nmssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) k) k# n  e3 t% o& |
, o; s. Z4 f3 f* V
Failed.');9 d2 T! J* l/ U/ V* c& C* E- j; L
}- H7 A$ W& ^* {* e# d' n
Connect();  R2 Z! S( S, r
; [8 y4 A$ K% O6 Y; K1 F& h5 [
function InitForm(){
( V" z" E0 v: k5 A2 u/ a) _) ?//layout for the form- T7 ?  A' b# Q% q
echo "<strong>Send Items.</strong>
' N# _, r* z. B; n' S<form name='select' method='post'>
+ {$ F% a  b4 T- Y<lable>Character Name</lable><br/>+ a# Q0 o# i* j+ ]1 k, {' ~; Q( r6 c
<input type='text' name='char'/><br/>
0 h% q1 h) D( V7 e( G& K<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
+ Y# J0 g4 h, n5 C, U9 r- O9 O5 p<input type='text' name='item_name'/><br/>( f. e# S- {) i
<lable>Item Amount</lable><br/>
9 k: G& j0 {) Q<input type='text' name='item_amount'/><br/>
+ z: O- I" z" |" I6 F<lable>Item Upgrade Amount</lable><br/>* Q0 n( q5 z7 F! o* w* b& K
<input type='text' name='item_upgrade'/><br/>2 }9 P  o, ]% w
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
5 l/ X& `9 w+ r
! _% {) [1 t$ e9 k4 r</lable><br/>! U- a1 w  K5 b% h. I# n- \
<input type='text' name='item_element'/><br/>
- x! v' o( Y3 M/ q# \; ]<lable>Element Upgrade Amount</lable><br/>4 o, K' d$ M$ T" Y
<input type='text' name='element_upgrade'/><br/>: `  R$ S" H2 N* v
<lable>Pierced Amount</lable><br/>
! ^: U5 u1 I( s* b) W- P<input type='text' name='item_pierce'/><br/>
8 S" b% F" U* R9 }0 \, n<input type='submit'/>" X3 h8 q3 |2 A  m  x3 O" Y
</form>";6 [! Q: i6 W# ?5 O# T
}; ^; @4 F" R8 r9 b4 }

9 v; v  L, O9 ]7 _" A4 vfunction PostListener (){/ `# e/ @! f% f3 V
//Add more post variables if needed and add them to initform() function aswell3 }. B- }9 c$ O" s2 }- r
% R7 b$ [# I( N- ?5 V
################################
8 W* q6 t* b' k1 M" R9 X##### Connection and Post ######) r" s4 E1 O  d$ r. s: G
################################& F5 F3 D- t3 H6 P5 C8 ]' F
$name = @$_POST['char'];
& f2 i' i+ w8 L# u' @$ItemName = @$_POST['item_name'];7 \% _; i7 N! G9 L* O- k$ @8 V
$ItemAmount = @$_POST['item_amount'];; y5 O% O3 b+ A  k- D) m
$ItemId = @$_POST['item_id'];
) Y9 p* r$ B  c" o9 d+ v. \2 j; C2 P, O$ItemUpgrade = @$_POST['item_upgrade'];
% J  J0 G- |, {) h$ItemElement = @$_POST['item_element'];0 o; z3 S1 J& h) N7 C' N7 f% d
$ElementUpgrade = @$_POST['element_upgrade'];
( i% v# h9 c- X3 D2 F6 v$ItemPierce = @$_POST['item_pierce'];
9 M7 C  c+ J3 H1 l; \, x################################# Q$ H; L, k! t  d; @
' R7 q6 q* s; P' r: d; f: a
//Check both variables for empty value
( I+ X$ l& }+ R8 K4 f% x' r9 B' o7 c2 _, n/ n
if (!empty($_POST['char'])){
0 Q4 N* n: s* k4 u, x$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where + M, {" e, t, u

  p7 u) }$ s+ i1 y# B6 H" @) }$ V3 nm_szName = '{$name}'");6 S- i  [! d- l& I7 }
while ($row = mssql_fetch_object($find)){
; a+ p3 \# i6 z4 Z0 J# M4 ~echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 k( ~1 U6 O. f5 [# j
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 3 L+ ^. ]- P' E) |8 V0 @

( h1 D& |3 y. t3 g; N- q6 n% I[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 6 o5 ~: [; u' S0 s; H6 T' p
, S4 @1 ]. k! |; d6 [0 W& `
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 5 y7 s$ l$ e3 _4 `0 j

; A7 q1 O3 [9 AN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
+ \+ ^% c: @  U) [" {; }2 |& W7 c# }9 ]( p
'{$ElementUpgrade}', '{$ItemPierce}');");* r9 t. `3 ~5 d
}4 y( F3 F) @3 F# V: e) U

* `; z7 S# B* o' N- s}
* b4 {- W! P, l7 S& @6 r
! W! L7 x) @" p9 v% l# `}8 V+ V; \6 R) ]. S; I4 N- Z
' x# J# W: W! ?: b* Q2 E
$InitForm = InitForm();6 j# g' J2 `5 g+ w3 D- Y, x
$Listener = PostListener();0 I& O6 v9 H8 D" J9 G4 }4 Z$ j
5 R0 n, B- L; b! R9 Y
?>" v; c  L& k! u% [7 S" O

# ^% A7 J* a; w8 W! A  e3 v; |# b/ E8 ]) Z- M
7 P$ k! }" _6 R7 Q

7 c. m' u% V  z$ e; \& G% F
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-21 03:23 , Processed in 0.066715 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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