飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php! S+ s: @' r/ X) l
function Connect () {
1 v2 @/ U' V- o6 A5 L4 Lmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
7 z* `: B- Y9 z/ ?
( t% {9 g8 k5 C0 M: v& ^Failed.');, f! I7 `. [5 U9 ?2 }! ~
}
8 b4 U+ C! Z! Z5 v4 R% wConnect();
7 H; X6 \, s: j) U: E/ q. x- t( k* V) b6 U) [( b, C+ T' u4 h
function InitForm(){
2 E  ]7 q( `3 e' J; V4 W8 ?) x) Y//layout for the form
0 F# H# `1 `/ w: D. t6 i0 becho "<strong>Send Items.</strong>
3 @! {! Z! K' ?! d5 V  t$ V( x9 R<form name='select' method='post'>
, q9 K1 B" L( B9 {. H- r" f<lable>Character Name</lable><br/>) \% O: y! k$ J
<input type='text' name='char'/><br/>
4 g- p6 Z: k8 g+ F<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>; V( B8 ^  h2 p9 {
<input type='text' name='item_name'/><br/>$ {( J  d; N! G* \: z. d( M5 s( x
<lable>Item Amount</lable><br/>
0 n1 x! A9 J  u; A; U3 o<input type='text' name='item_amount'/><br/>) i# V& N1 M; \9 Z, O. ~& f
<lable>Item Upgrade Amount</lable><br/>
( K# h$ q: D' y) N<input type='text' name='item_upgrade'/><br/>. D, F2 x3 }( \0 ^# N1 a9 p  H
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)- n. p1 S$ u+ U; d/ f
( `5 R+ ~& r$ h6 y/ I8 y4 K1 Z
</lable><br/>
0 b/ g0 H) d& v: M. \2 n1 G; d2 X* ^<input type='text' name='item_element'/><br/>
+ F7 W% V2 H- R) j$ I% x$ c<lable>Element Upgrade Amount</lable><br/>5 n4 A- p/ M2 Y
<input type='text' name='element_upgrade'/><br/>
; Y) s$ r6 Z, }* a: c$ P' U<lable>Pierced Amount</lable><br/>5 R( Z8 t: x: g8 {8 f5 H' Z
<input type='text' name='item_pierce'/><br/>
& D: f2 j2 K4 u" G<input type='submit'/>
6 L9 B6 a) a) l0 [0 h: ?  o+ S2 y! Y0 r; ]</form>";
' i6 J4 `' Y. `5 g; y2 b}7 E* ^8 @, b% y1 A1 z
# {+ V  C6 {+ c, M/ }& l" X
function PostListener (){
! e! {* e" d( v3 j4 X//Add more post variables if needed and add them to initform() function aswell+ U2 o& N0 w; H9 w$ e5 L

& @2 _7 Q0 {5 n; E################################9 r) L1 t+ M: |6 J+ _. z7 x
##### Connection and Post ######
2 b' {: n' r5 r5 u2 ^################################; x( Y: b0 j, a! ^
$name = @$_POST['char'];
# K# S1 z4 G* v2 I; r* N( W. E$ItemName = @$_POST['item_name'];
$ ^, v3 z" [  a" R: |$ItemAmount = @$_POST['item_amount'];
% @4 D& u1 f2 M5 C% t, B. Z9 `7 ?) x$ItemId = @$_POST['item_id'];3 @) S( @3 F- W8 X( T
$ItemUpgrade = @$_POST['item_upgrade'];  C) w! {* \- \: ^5 k
$ItemElement = @$_POST['item_element'];
( P9 Z  d/ u% A; J: a$ElementUpgrade = @$_POST['element_upgrade'];
; G! C( U2 }$ {$ItemPierce = @$_POST['item_pierce'];0 Q* ]& p; d* ?
################################: Z+ r1 W6 r; u3 x$ J0 [$ p, J* _
: J! C  S% \; x$ n! B
//Check both variables for empty value0 Q; Y5 e# ^, c# u; r9 O3 H9 m% X8 o
8 M4 ^# j4 h% j( G- P% l- R
if (!empty($_POST['char'])){
- s; v4 ?4 @% r9 y$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
- P, o$ \, p) S2 @, j' r
2 I' l- _) s& r) \m_szName = '{$name}'");5 Q7 n0 ]! R: L+ k$ R! K
while ($row = mssql_fetch_object($find)){5 M' c( Q. C0 C. O0 d
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 G; F$ H/ Q5 Q" V
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], . Z& `! a; `2 T6 o+ Q$ T

. I' a0 B2 L7 e[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
4 T5 l* ~+ b0 d; _7 C& A4 A: S% b( A" _- p6 t
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', + q& @& D$ @2 P) f6 {
" F6 T& r3 {2 ]* ?$ p
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
% \6 Y' S4 F/ e8 S1 m: o6 f' M# |2 J; j2 d- B7 X
'{$ElementUpgrade}', '{$ItemPierce}');");/ c4 ~4 h# q1 {+ ?) {' F
}
% B3 l+ K4 ?( D: w
6 Y5 {/ Z; y, ]/ G* q: ~7 \$ h}
* U; I7 d# ~& e) m7 l/ `2 r( Z* i- q0 }% h5 ?" Z( c
}9 Q# y$ {- D  @, q

, q7 u1 v; t% h2 r* O" O$InitForm = InitForm();, Y  [, R& U7 L, y: D& p
$Listener = PostListener();/ S: {/ t  M: B; P8 A6 M3 }" D5 J: Q

; @+ c6 O. U  H3 a?>* ?& e% W( |* p: B' I, e- K

1 w$ c" O/ M0 `7 }5 i/ t# A2 C6 x0 ]% l# a9 z
; Y9 H, @8 f: O1 N: D, F
+ _0 n8 i- V2 @
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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