飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
) \" |0 Y! ]. r! G4 P" t- A8 _function Connect () {
* A! j2 l, X2 _& L( J' v! p0 ]mssql_connect('Server','UserName','Password') or die('Error: Connection to DB $ j9 t1 B0 [) Q+ {+ y7 ~# f
3 j8 p/ B4 A$ R! S
Failed.');8 h1 C1 @& a+ b
}: g; L2 n* l2 b9 ?2 _
Connect();- b1 `% o' e9 K2 i8 [9 u7 o5 t. L& L

/ t1 z+ B' g  Q$ `' I& }$ B& y7 Pfunction InitForm(){
+ g; C& w  Z: O6 ^" _# j//layout for the form
3 C. h5 a' n% G3 |7 Hecho "<strong>Send Items.</strong>1 [# Z, I! }+ C% N! q! P
<form name='select' method='post'>+ B# P' L* _% {/ U+ x1 ^9 g
<lable>Character Name</lable><br/>
; E8 Q( B7 e% e. v% ^# @+ l<input type='text' name='char'/><br/>7 V1 @' Q" z+ _
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>& R0 {3 w: I( `, R) E
<input type='text' name='item_name'/><br/>
4 W" {: r$ X3 S5 r3 J+ @<lable>Item Amount</lable><br/>$ D% e  C, ^# d+ W: h
<input type='text' name='item_amount'/><br/>
3 V+ {9 k  A- I& @+ u8 S0 r% e<lable>Item Upgrade Amount</lable><br/>$ b' ^2 |& _! w' P- F% r; s
<input type='text' name='item_upgrade'/><br/>
, }: q: }  R1 A' |8 w<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 F8 @" m. v+ b$ T6 ]* ^, d9 \0 [9 x

5 {  b, M6 N- U8 ]' `3 v, O</lable><br/>5 B; s1 P; {- [& E
<input type='text' name='item_element'/><br/>
3 @, M$ s6 a0 `" L<lable>Element Upgrade Amount</lable><br/>: M" F9 D: m& G
<input type='text' name='element_upgrade'/><br/>
  a5 N  d5 [/ }5 ?  k. q<lable>Pierced Amount</lable><br/>
2 d. o, \4 }+ w; X! [4 Z, [4 B. ]<input type='text' name='item_pierce'/><br/>
: D  `7 R  U  D6 g1 z<input type='submit'/>: Q8 I; G3 z! M" S) D1 k
</form>";% b) B0 q- p) C& j% G/ ^9 e
}
. r! ?7 a! U/ Q' [# i1 i1 ?5 d0 }5 ^9 z' c9 |$ a2 |2 v
function PostListener (){
* q, s. d2 Z' C# }6 ~7 \3 d# w) f4 H//Add more post variables if needed and add them to initform() function aswell9 D5 D: i$ Z6 k& N3 j

9 j# C1 ~3 _: i, N################################
4 b. F1 m' H) Y$ @6 v##### Connection and Post ######2 d6 V) k* h0 R0 p
################################
/ o0 \0 S/ I2 p2 M! y1 _$name = @$_POST['char'];
- g1 d, y1 Y9 o& `( R( j$ItemName = @$_POST['item_name'];( M, A- {5 m, e9 c/ e5 U  }, s
$ItemAmount = @$_POST['item_amount'];8 }) O) V  }, q
$ItemId = @$_POST['item_id'];
. _, C7 P. B; s+ y% X7 i% w$ItemUpgrade = @$_POST['item_upgrade'];
( r+ J% o$ n+ q3 g$ItemElement = @$_POST['item_element'];5 c" `: N( o/ P1 D
$ElementUpgrade = @$_POST['element_upgrade'];6 ~9 }0 u) B+ A
$ItemPierce = @$_POST['item_pierce'];1 o: N5 x9 N9 L: [
################################
3 N0 v: t+ Q" y5 E" ~: e, _& J  ~: ~1 A( G' W
//Check both variables for empty value  k" \, ]: D. r) k) R
# _" K" V+ Q. F1 Y- I* G0 c) F
if (!empty($_POST['char'])){
" J8 y1 \2 l# j3 l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
2 ^9 X1 x2 Q# _+ V# r: v% `5 P/ H' _/ B. b
m_szName = '{$name}'");
# `" g3 k8 s2 o" o$ L, Cwhile ($row = mssql_fetch_object($find)){
5 v; ]7 J) ^: p. Qecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";9 N3 w  N/ q% _$ L. i* m
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], - {# d( A- U9 I8 {  E5 G

9 s4 X2 B1 G0 {( }) g- ^[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
; h! Z0 {2 ?! n+ P" D9 N# v  K8 ^. T* q* [. x1 }
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
% B3 x* E$ v% {  |! |8 C2 Y% D) U
. H' y+ j  y' A9 R* k, s" hN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', $ X0 D. }( l* B( Q( z# m

: w7 K" p+ ~2 v1 }5 n: Q1 U'{$ElementUpgrade}', '{$ItemPierce}');");+ L+ P; Z  D7 ^
}
' ^% x/ q1 T8 W2 x. j3 w) J. |" t  Z3 K. O
}
( i% K  I  v- q1 a+ L4 L7 W3 |6 m7 O2 {; a. ?0 q
}
9 N) n0 b3 {1 G: o8 W
$ |; S5 a8 |6 Y5 Y$InitForm = InitForm();
. `& c9 d& H' {" G8 |+ j$Listener = PostListener();
; u4 ?/ Q( j. I  ~% A) @; U' N1 x3 W
8 O& f( A# ]8 R7 z) n6 _9 B, i, d?>; T& b6 `& [5 B. d6 ?( {8 o
* z3 D7 [9 \! u, \! [! a! R4 ^7 O+ l

- P, E" L& }6 a2 _$ K
. M$ F6 \6 G, p9 i& O( e4 R' i! ~: B- m! x
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-9 13:37 , Processed in 0.058372 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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