飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php4 ^* W8 \$ v4 W7 K
function Connect () {, |+ P) W% e6 L1 f# H" |
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) R4 u) l# Y4 J

( Z9 j& }6 V( @# h: M( JFailed.');, A# U9 v* |& r/ T* O4 F9 S
}( W4 h- c* r% `6 u) e, J4 z
Connect();# `* Y  W% E4 ^- @- ?9 w
7 K" B& W0 U5 D- \% h$ C
function InitForm(){: Z8 r: @; k: ?: g8 B* _
//layout for the form; B8 i0 D  g, }6 B& S7 ]. _( [
echo "<strong>Send Items.</strong>2 u1 f# u  ]. C7 a" s
<form name='select' method='post'>" _. P9 z7 b# ?+ V& a2 r
<lable>Character Name</lable><br/>6 R. a" Y& ?2 ]
<input type='text' name='char'/><br/>
( k* |7 \8 x! C* Q  v<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>$ `% y; M% a9 U6 s. [0 `
<input type='text' name='item_name'/><br/>' @8 L6 Z5 ~4 a/ @5 s
<lable>Item Amount</lable><br/>
) l* ^* C$ Y, d5 |0 O6 D+ C<input type='text' name='item_amount'/><br/>7 W  [$ L1 ]+ y5 a  ]
<lable>Item Upgrade Amount</lable><br/>- Y  J  B& V: w( {
<input type='text' name='item_upgrade'/><br/>
3 B6 m3 O. n4 W9 Y<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)  d9 t' ^' D' a5 E" W' s1 l
: Y2 h8 g5 a6 |5 M# n0 i- r1 ~
</lable><br/>4 P& F, V' \5 G8 @" S/ U
<input type='text' name='item_element'/><br/>
+ s) t' N5 z. U  X  F: z<lable>Element Upgrade Amount</lable><br/>
3 t* T+ @7 l/ y6 a<input type='text' name='element_upgrade'/><br/>
; H/ O: b& r+ K" k% F<lable>Pierced Amount</lable><br/>( Y, z1 v9 M* U; H$ h  O; g) F0 q
<input type='text' name='item_pierce'/><br/>- o$ G8 k  o1 F" X4 V9 n- f" G
<input type='submit'/>
0 d6 o0 l, T8 l</form>";- `% J3 y4 }7 d+ W0 i4 d
}# T  V1 q' I/ b/ i6 h" P
/ W  T: [6 G4 i& g$ S1 |
function PostListener (){
/ Z# q$ ^+ ?  q0 r" [7 l+ x( p//Add more post variables if needed and add them to initform() function aswell2 x: a: j) ]4 Z6 P2 W. k: ?0 \, S

! x8 t5 ]8 T6 m' Y8 ^. s################################& M0 O7 B# V* z+ U
##### Connection and Post ######
! S8 H: l' p! o6 z################################
; F& A& Z9 r* L. `' G% ]0 x$name = @$_POST['char'];
( }" |! c; R9 \. |/ j$ItemName = @$_POST['item_name'];
6 m. Z- x. r; n6 w$ItemAmount = @$_POST['item_amount'];
+ [) @, i2 C5 H8 U/ {0 n8 a$ItemId = @$_POST['item_id'];
2 Q5 e& L  h* v; Y$ItemUpgrade = @$_POST['item_upgrade'];9 R( p$ J( _% c, K8 c
$ItemElement = @$_POST['item_element'];! c/ e" p7 B. D$ T8 M
$ElementUpgrade = @$_POST['element_upgrade'];( Q7 ^+ _: l1 ?, Z
$ItemPierce = @$_POST['item_pierce'];* B% o1 U' `& y, p- @# @: |3 d
################################! Q" ~  G* _- y% N' q, P6 j
6 w- x; D4 l! @, F' d
//Check both variables for empty value
  L8 q* X3 V1 Y9 ]8 o% {5 D+ ?( j' o# Y4 H, t
if (!empty($_POST['char'])){
+ f$ R( E+ C8 p. `% J$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 }& w" ?" ^  Y; H! h

5 O# ?$ u4 C. G5 m) M- @5 T- Im_szName = '{$name}'");
9 }% u9 d0 r& g+ z  swhile ($row = mssql_fetch_object($find)){& O% H' v( _. u& {; k' h6 s% }" j
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";3 D4 k2 o9 y; C
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], & P( J9 o& F" m, [, X) A% i& g

. }) j0 {# g' [* O( H7 Z% p& M6 {[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 3 C5 ^6 S' C  U# k9 W/ L
7 s" B2 j' K$ ~6 f9 j
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',   o6 Y  B7 |, i# Z+ Y

, J4 q* I: h" K& f; F4 IN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
7 d0 e  ]- R2 A) q4 A+ s! {9 D, Q9 C! L# T
'{$ElementUpgrade}', '{$ItemPierce}');");* S. t! E- g4 M2 }
}6 m! Q/ c( r! g8 V! }% {. B5 D, {* @
: Z5 y) @5 \5 u. W
}
( i2 s$ H- F) H
2 Q6 Y7 C  g! f" G, ^/ B4 ^, R}
, P: _) R: x1 H$ A  _
( g0 J9 M1 t* v& k2 H7 u$InitForm = InitForm();! ^4 ?* |6 q7 Q2 X5 D" u
$Listener = PostListener();
; J. Q# y, S) A- f5 \2 T4 C- m
?>- H& I$ W! o# Q
/ N; Q7 c+ ^9 }5 L  C# b9 _: H  x
4 N  O3 s- y$ q) N+ G' b$ b2 |% k
- B- c4 x; U$ k) L( ~

! L; t& o; q( y( Z
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-12-13 22:13 , Processed in 0.063298 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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