飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1090

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1090
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php
: J3 O' ~( f! ]. [function Connect () {
' M, \$ S4 ~! h' B1 C1 ~9 T8 b! _mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 2 |6 b5 p% l# t  y

/ L3 b: w) e+ G' o2 \Failed.');6 ~6 {" S/ c8 z
}3 w2 p: ^' u  j3 Y* b
Connect();- q, c, y" j8 v2 e8 k

( S1 K5 T+ E/ y2 w+ Dfunction InitForm(){+ R2 @; P$ |+ B" [! U, J: Z
//layout for the form5 T! u- T! H/ w# }1 D8 l8 i1 w. A
echo "<strong>Send Items.</strong>
* @1 f/ M0 S2 j, p<form name='select' method='post'>
8 p: _) w* g8 ~4 [" B: N& ]8 n<lable>Character Name</lable><br/>
/ q; w6 H$ S, y& G1 ^<input type='text' name='char'/><br/>3 d1 D9 a1 j, z$ n
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 f! I! h$ i. ]6 _2 u) t<input type='text' name='item_name'/><br/>2 k$ \. K) b. x6 a6 w
<lable>Item Amount</lable><br/>
/ ]8 j/ g1 v! j1 K7 ]" Y<input type='text' name='item_amount'/><br/>
6 Q7 ~& s5 F  O2 M& C* S<lable>Item Upgrade Amount</lable><br/>
7 f' b6 l, _- U- y2 `# W<input type='text' name='item_upgrade'/><br/>
* Z* p- B+ X0 {  a* I0 \8 {5 G+ M<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)+ w% M% [" L. E

3 r/ `; Y$ a, v" F, M</lable><br/>
; B  x% m% ~3 Y5 [& l<input type='text' name='item_element'/><br/>
* M' G- V0 f  S, [6 n0 v<lable>Element Upgrade Amount</lable><br/>- ~) {& h' N. s
<input type='text' name='element_upgrade'/><br/>+ D2 f% |  z2 Q7 h: U# E6 V
<lable>Pierced Amount</lable><br/>
4 _' |9 _' u: U0 ]<input type='text' name='item_pierce'/><br/>: r' t' ^: |: l) o; }
<input type='submit'/>
0 i" k. N' R- j: s, S: T/ ]! J" w</form>";. X7 ?7 S6 W; [0 W% o4 Z! y
}
8 [2 I9 I0 l" B8 D: x/ G; A- q8 P: Z5 K, X9 \4 {
function PostListener (){9 p" j6 f% G; c3 U8 r/ E/ f& i
//Add more post variables if needed and add them to initform() function aswell; s6 D' e) z! |/ y

' p# R; x( v. [# R; `8 E################################
6 l3 x) o3 n/ @4 k##### Connection and Post ######
! R. t% v0 _! s5 Y################################
2 z8 K2 B7 I" U: c0 t* W: |1 _$name = @$_POST['char'];" P( C: l+ _$ y# d  }. ~7 ]6 Z
$ItemName = @$_POST['item_name'];; F2 p* W# z& b% i
$ItemAmount = @$_POST['item_amount'];6 L6 B, u1 a1 o2 W
$ItemId = @$_POST['item_id'];0 Q5 ~  T$ H  Z' ^+ n
$ItemUpgrade = @$_POST['item_upgrade'];6 `9 V% y  n# v
$ItemElement = @$_POST['item_element'];
0 b7 `) C7 k* C) K$ElementUpgrade = @$_POST['element_upgrade'];
! [$ Y. f/ |: ]! C7 P, R$ItemPierce = @$_POST['item_pierce'];4 w( Q  \" q+ V! j4 m1 y' w
################################
5 ~; I1 y1 q- h8 Q7 `
6 Y- U) K. A. c//Check both variables for empty value
8 f$ J/ ?2 c4 I1 O' B2 M3 z2 x; D5 i7 Q! _7 T% j' {
if (!empty($_POST['char'])){
' P- j" D& E7 [5 S9 W$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 7 \8 S$ w0 _# j
* _& i' ^: e$ ?. m1 X
m_szName = '{$name}'");
+ {' ~: l# y* @' _/ o( uwhile ($row = mssql_fetch_object($find)){
  O( d0 H6 H1 ^1 R! f0 h; \echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";1 H/ Z( z) o! \9 E. w0 U
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ! Q' m& j: _% u) X/ V0 o) f

8 p0 t1 F6 n9 Z, p0 x0 M+ ~' X[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 2 @& b, L7 p1 S& N

: a; g5 c" g1 ^) n6 m( O. L1 @1 B[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
% w4 l- s# K5 k% f; Q9 d  Z. x3 j. Z' \$ S! {/ F4 d0 A5 X
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', + b# w2 v; p' a3 X8 M4 Q- s
5 r$ l( C+ y! ]  C+ x  G
'{$ElementUpgrade}', '{$ItemPierce}');");& X& W0 g! o& \8 f& h! I! b
}0 [4 [+ b  O# }3 C8 a2 T1 ^- J

' Q$ {7 a  L' l4 e}
+ R0 J+ t. O( X- E# @! M
! Q; i" P* X; q$ [}; n7 Q( f2 b9 F" \+ H: q0 @3 S

3 z: q) k# S6 W: x$InitForm = InitForm();
" l4 s# n1 {" O' Q: o$Listener = PostListener();, j8 E( O7 V* k: T1 U2 ]
2 d; L0 u' h7 C, k8 {7 J- J! d
?>7 B7 W/ f$ a$ O
. ?; W$ W% [+ z; w3 u, F

9 {# n- m+ i: k; \0 u/ i- e
+ w+ d' s1 P. z: \
2 e6 A' f% w+ b' s! S, v3 w( m
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-27 21:21 , Processed in 0.065684 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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