飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php6 t# d5 F8 y% t9 q
function Connect () {
' c' Q2 A& Q/ w4 Z8 zmssql_connect('Server','UserName','Password') or die('Error: Connection to DB $ J$ _/ K! k7 U1 T5 b2 d
4 C' ]$ g5 H$ ~- S
Failed.');
& P: @' y( q3 V8 O9 C}
# B5 e- q5 y, IConnect();6 p% [# L  I  O$ {) H

: {% d/ L, _+ A' Ffunction InitForm(){( M. C. `9 _4 }& R( \2 D
//layout for the form
6 U- p. ]1 ^/ _( B0 }# V1 W% eecho "<strong>Send Items.</strong>9 g0 h) _! p. ?5 r
<form name='select' method='post'>
7 r" Y# o! e: i4 q$ _<lable>Character Name</lable><br/>
7 R2 }; H' ~* K7 L2 d<input type='text' name='char'/><br/>
% n0 j9 U7 D5 w2 ~  e! I<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
  M) ~8 o$ T0 Y, Z8 I# k<input type='text' name='item_name'/><br/>
7 ?" I% `- g% b% j: T<lable>Item Amount</lable><br/>
# h( m5 S' L7 g5 b: h6 k<input type='text' name='item_amount'/><br/>! T+ e! F% E/ j, ?/ p7 ^9 e6 I
<lable>Item Upgrade Amount</lable><br/>0 j; p9 s% |! z$ O% |5 F
<input type='text' name='item_upgrade'/><br/>; D; g5 {. v" g, {5 x! O  T% \1 [
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)* ?/ p7 z/ }' {, c

  M* V# _7 a2 W: e</lable><br/>0 Z8 w  J1 W/ I1 X* Z: _
<input type='text' name='item_element'/><br/>
4 d8 O6 y& t: M+ p+ a5 y* W5 Y<lable>Element Upgrade Amount</lable><br/>, l' Z1 g) Z% e5 ]) j8 q# z, p; @
<input type='text' name='element_upgrade'/><br/>
% E' U1 }& P7 m+ U$ m3 U, I5 C<lable>Pierced Amount</lable><br/>! b7 X8 S; G1 Y2 k1 F
<input type='text' name='item_pierce'/><br/>* B  [' n" v5 c; x
<input type='submit'/>
; I( r. E% S0 ?1 h4 A</form>";! [  T4 \( }- Y7 V* Y) E( M- n
}
" _& O# F- I4 M, i9 c4 [- n: A9 Q* |
function PostListener (){& g# ?! s, M  o- v' }' {
//Add more post variables if needed and add them to initform() function aswell
* n4 d2 [* p6 S# ~
( j8 K; H3 w( [6 x$ X################################
# L/ E2 Y7 n$ p8 \##### Connection and Post ####### m  w! B$ {4 T3 b. j3 E1 m7 E+ [& i
################################% A6 q. @" n1 e, v9 o/ {1 `& F
$name = @$_POST['char'];3 O# {- X1 e5 L2 c6 d2 {
$ItemName = @$_POST['item_name'];
# \/ r( ~. O: j! w2 ?+ C$ItemAmount = @$_POST['item_amount'];
6 Z6 I( x  P; A6 w$ItemId = @$_POST['item_id'];
- Z' _( L* |5 H. ?$ItemUpgrade = @$_POST['item_upgrade'];8 N" P: m  M/ L9 l! n
$ItemElement = @$_POST['item_element'];
5 l  a6 ?6 e  X7 J( V$ElementUpgrade = @$_POST['element_upgrade'];
7 f& {, d5 m3 B( A% M: g1 a8 ^$ItemPierce = @$_POST['item_pierce'];
- e, N. R' O6 [0 A################################2 h% G: a. r/ c  {* _. I7 Q
0 p) O! Q2 B: s$ N3 {* w6 Y
//Check both variables for empty value! l4 `3 `8 f/ o, H, V4 Y
+ v; K; b. ~; E: ^0 B7 u  Z
if (!empty($_POST['char'])){
0 f, x4 J/ X2 @/ a$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
1 N  C0 Q" Y  j' B& Q( k" g6 B1 O* o! {8 p7 U8 C
m_szName = '{$name}'");
3 T. I2 V, p/ A5 ^( ?% \! k; Iwhile ($row = mssql_fetch_object($find)){
% ]: o  h- z& I2 [echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 t) C& i) }, v9 h8 s9 H( z
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], . X2 L; _5 l9 O* P( x2 m

) ]! _" x) t: P8 d7 F; h[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
4 E7 b: P4 y* v/ e8 N( Z, y) o, f/ L) r# s- T( ^
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', - U0 {) Y/ r' `; Z9 v* [

4 c, i) j4 o5 A1 GN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', " k* K4 L  U$ p4 x8 O

, n0 S4 s& W" ~'{$ElementUpgrade}', '{$ItemPierce}');");) B; L6 ?8 b- X  t" l
}
+ Q$ Z# B# U- `7 {9 ?4 J1 Q% Q$ ^1 R
}
5 }) [% y% [' R+ E9 G  Y3 Q2 w# T
: z) q6 U+ a: F# h; A+ q}- l/ o- p8 Z8 C, ?0 y  w# X

1 F# A! _. r  J9 |- v* O$InitForm = InitForm();7 v# v1 D" L1 X/ b/ Z# P1 N
$Listener = PostListener();
" j; ^' i& L, \' C: w2 z& S- y
3 e& Q( P' b# R3 K% ^# L?>
" n9 Z1 |' ?: T8 q- w
4 T* i/ d5 S' g& G% K# F0 J0 N1 g0 v' U- H8 G) M% a
7 j( m2 U7 P1 i% R- ]4 R9 J5 z0 Y
; A# Z- \( ^! ^) a3 C
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-17 00:19 , Processed in 0.058433 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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