飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
; D4 A( {; D0 [/ cfunction Connect () {
  g' H' `. O) L1 C! vmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
4 r% N* q5 f  d% v1 P# }8 I9 S- J; o# a% D& |+ o; s3 D( ?2 B( L. |
Failed.');
* v) z) v$ h9 r  ^! D! z6 P: `}; M$ \) F: L8 f0 e7 l
Connect();$ e' L$ ^; U0 K2 w7 m
+ k/ R+ r. R, X$ p  h" [! l
function InitForm(){
' p0 K2 L7 I' }# I# E! f  \7 z//layout for the form5 `" F0 K' e  M) y( {( J% Y
echo "<strong>Send Items.</strong>% ?+ P7 T6 _2 h$ {8 H& B
<form name='select' method='post'>
' l2 K$ E: B1 l: b. ], w<lable>Character Name</lable><br/>
: G5 S" M1 y! p" j" j9 a' y6 h  `<input type='text' name='char'/><br/>8 I) e4 [7 |/ s% H
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
4 R2 _. {1 h! r" r  m6 d' G<input type='text' name='item_name'/><br/>
( }' g( Z5 x; v9 ^4 t6 b/ ?: h<lable>Item Amount</lable><br/>
0 C7 w2 Q9 {  M+ u- Z( |( d<input type='text' name='item_amount'/><br/>+ r: K1 U" A2 m
<lable>Item Upgrade Amount</lable><br/>
/ X, ^+ V2 v  x<input type='text' name='item_upgrade'/><br/>
) v) Z; }3 J, _<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
, Z5 a; ], B) [6 [$ [
8 E0 \5 [( p% ^3 j/ b4 r4 v</lable><br/>: @( U4 B: T* M1 Y) B3 U! x5 x4 M
<input type='text' name='item_element'/><br/>
8 w8 g* T9 z! d& R5 G<lable>Element Upgrade Amount</lable><br/>
( X1 n8 a: S' Y+ D& e7 T<input type='text' name='element_upgrade'/><br/>
* }7 j3 N; M# T( h2 F! D<lable>Pierced Amount</lable><br/>$ d& C" d5 f& P; Z# r4 u- w! E
<input type='text' name='item_pierce'/><br/>- b. |' Q% f! c3 Q/ U
<input type='submit'/>; W2 E& V6 \2 q% L# w) X1 J5 g* H/ t
</form>";
+ R0 D+ f& h  F- Z( L- s  h7 G, ]}9 h7 ?) w6 n& f4 S4 e5 ~. T

7 G* S; B$ i8 Rfunction PostListener (){' r( ]) `! [3 q- E, }# p! O5 D
//Add more post variables if needed and add them to initform() function aswell% r/ @! {% k% m7 e/ B8 q
9 p+ M! [& b  y3 \  ?$ h, Z
################################7 r: T) V  B; P9 G. Y1 x3 w' k% }
##### Connection and Post ######* h: }+ v1 O5 E  p( k- l
################################( U2 Z' n# b6 P( y( u' P) |
$name = @$_POST['char'];+ e! b/ W1 n* w* S& @, {
$ItemName = @$_POST['item_name'];. A& E+ @8 @% \" h0 n6 E4 a" m
$ItemAmount = @$_POST['item_amount'];
# H3 e% `3 Y, c$ U+ F$ItemId = @$_POST['item_id'];+ P4 d: E5 [/ J7 p
$ItemUpgrade = @$_POST['item_upgrade'];* F: l! W5 c9 k, {5 n! _
$ItemElement = @$_POST['item_element'];0 a1 q7 g- |2 D
$ElementUpgrade = @$_POST['element_upgrade'];4 j  \9 [0 Q9 {
$ItemPierce = @$_POST['item_pierce'];9 Y. W; {1 V& D1 R. C" h$ ?
################################
( C$ N0 \' c/ D9 g' F; X1 }7 z0 ~' \
//Check both variables for empty value
- e8 T6 J8 ^0 U' T: k- C. {, G7 q* C4 v! d0 \1 y2 ~. z
if (!empty($_POST['char'])){8 j& }0 D$ H" V* \, c
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where - n$ Q( ^6 q7 h7 l. X* e8 n
! U# H7 _' g& S* }, r
m_szName = '{$name}'");
9 m4 c7 d! x9 p  g' `while ($row = mssql_fetch_object($find)){
! n1 k' C" u+ A$ K/ ]4 aecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";0 M* J+ E. x5 @
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], / Q4 z$ J3 {* I+ n

& [1 |# V9 d% [[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 5 I4 v: b: i5 k  |( J

; g% f  E& [, W[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; o; A) A) I" \4 X3 b3 u  z1 S- o) f
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 5 V4 u0 Y5 ~* @, [/ w

* ~* r. z2 h( k7 \: g'{$ElementUpgrade}', '{$ItemPierce}');");  g9 _9 K0 E/ l
}0 K4 N6 F4 ]8 H
4 g% U6 C% P$ x, _; `! w, S) P1 L
}+ _  V  K/ T+ b% ]" C
) l/ _# Q: o7 `) `
}
% j& l; S% \- Z& V% d! O# ~9 Y
: z* Y/ f7 O2 S6 x: r3 v4 X$InitForm = InitForm();* k" `5 H0 ]3 {
$Listener = PostListener();, c0 s8 P$ x+ E3 C$ a/ a* x7 ~% G

+ c: p  L$ C3 R+ a% ?: w; l) w?>+ P2 F3 N% Y3 C# w: b' ]

+ J) ^( m  _' s
  g5 [8 q0 q  Q: K. I0 |$ U4 ^4 q4 F

4 b- l- h5 O# r- b) {2 P2 P
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-20 11:36 , Processed in 0.059542 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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