飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
  ]5 ]" ^3 n* I" w  gfunction Connect () {
/ U& \, o! Q  `9 Wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB # k5 Y6 m" h' ]4 l/ O+ Q3 g

6 C( x( n  C# f4 ?+ ^8 XFailed.');
3 R4 R' Q8 x  G2 {6 B}! _/ e; u: f& B: |& \6 J
Connect();
! v" n0 O9 ~# ?' X
. g3 j- w# j- t/ b$ P- ?function InitForm(){
; r+ Z( [$ [  W5 x  J8 \3 r( L3 M//layout for the form
: U7 a3 y6 |1 P! Yecho "<strong>Send Items.</strong>0 z' R* {8 y: @9 j- D* n: L7 |
<form name='select' method='post'># a0 x. e1 g; r/ D6 W  ~
<lable>Character Name</lable><br/>
) t, O& N1 u3 z& Y<input type='text' name='char'/><br/>" X2 E0 h& I4 [6 u2 S6 R1 ^
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
7 Y1 X; l2 J3 J<input type='text' name='item_name'/><br/>, d7 m6 R0 m% f  q$ [/ @
<lable>Item Amount</lable><br/>
; n) t2 S/ [  L6 q<input type='text' name='item_amount'/><br/>
$ X5 w: F# ~4 b/ s<lable>Item Upgrade Amount</lable><br/># d8 Q1 T; y/ y" l6 D
<input type='text' name='item_upgrade'/><br/>
& w% ~, b- P" R7 x' u5 K* [1 }<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
: F! G* C$ Q% W+ _. r4 p
3 T  s- q. z) a4 h* _* E2 E</lable><br/>  [) f/ b$ U: r% L: P6 }/ V; [9 u
<input type='text' name='item_element'/><br/>
7 x8 I4 g1 i4 G$ M( |<lable>Element Upgrade Amount</lable><br/>
+ n% j( t' X+ C: x$ A; [<input type='text' name='element_upgrade'/><br/>
; m/ r7 A! [9 h! s<lable>Pierced Amount</lable><br/>) g9 ]+ M8 C( O3 W/ |  I& ~
<input type='text' name='item_pierce'/><br/>1 d3 K4 K& y8 E* z* d, [
<input type='submit'/>
% x" V2 W2 @) U& T% E. j</form>";
) T' P; `6 F; @  I! ]3 S}
, e. z) e& Q- K8 V8 M
: A" k7 O& \" `( B3 _function PostListener (){
: m! v/ U: V* s& w//Add more post variables if needed and add them to initform() function aswell
4 v  `% m4 r  \* S$ E
" V8 V- {+ V" e; K' m3 v7 F################################6 O  V. V/ A! f% I* `. L$ P
##### Connection and Post ######* u" {2 c" U4 Q/ \$ i2 K6 {/ U
################################/ `$ ^9 Q- Q0 [
$name = @$_POST['char'];
( I' r$ f7 _7 J$ItemName = @$_POST['item_name'];
- k" ~# W, {8 }! ]6 t/ i1 V$ItemAmount = @$_POST['item_amount'];3 v, [1 f) u( Z: M7 y
$ItemId = @$_POST['item_id'];  W! [" y( }5 Z% _8 `0 v: }, a! Q2 M$ _
$ItemUpgrade = @$_POST['item_upgrade'];( J) n$ |; Y( T+ E* m; F. g4 F
$ItemElement = @$_POST['item_element'];
$ V# G5 G+ c& U4 N- Z; o' q$ElementUpgrade = @$_POST['element_upgrade'];" |) m2 D8 L9 w' d
$ItemPierce = @$_POST['item_pierce'];
$ S) D0 s$ g* |' z" x& y. n################################
, E- }6 _! S5 W, h. W" }* P6 r! m1 c
//Check both variables for empty value8 ?, M6 |( a3 Z0 [& T5 V
3 ^4 d" A+ m/ k6 Z
if (!empty($_POST['char'])){' Z6 g7 X( Y  N8 A+ ^
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
+ f3 E  B5 O7 h$ u+ {  f/ ^
$ P* C7 Z& |: U( n  Y% M- sm_szName = '{$name}'");3 h: L. y0 k8 `0 v9 t8 m3 t
while ($row = mssql_fetch_object($find)){! C% z. P1 o2 X6 |4 m
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
0 K$ Z! p$ s" ~; \9 b1 l$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
2 i: ^- T. a7 }. l5 P1 X, B5 x7 w
3 \" G, U; N! f( Z: w[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
7 C2 E1 D1 W- V2 d# U/ u
% ?9 w+ v9 N' _8 g[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', # {& n* A( n* o! r
- h6 H% p( b9 ^& w, }
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', % C, K$ g" R- H* ?. S5 w

5 i& u. e+ n  c4 m'{$ElementUpgrade}', '{$ItemPierce}');");
' }- Y! m8 u1 h  M+ [0 O  X}
; O6 [4 f* W" C& ?) x
, {8 F& u" I4 c7 w/ C/ q}
9 |/ `: U2 j, j/ e2 k! X  G" X5 x4 W3 A2 c% z
}( t3 ]. S6 q. D1 V6 m' P" A7 w
# b' q* V# K( Y: y# ~- }
$InitForm = InitForm();/ X+ I$ k1 z4 B# }
$Listener = PostListener();
& R1 P3 a6 w: t1 r. j1 @8 \) Z$ z2 z8 G: I- b
?>, r$ n+ S1 t6 T, D
7 l4 S6 k: _% Q# c" _5 H
. W% Z' p! o' k! S
0 v# w# }" u, {% t+ ]

0 H# S6 d2 ]6 x: Y" D
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-19 07:36 , Processed in 0.060917 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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