飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
8 G, d. q" ]1 Q, F# l  n6 O0 d" `" kfunction Connect () {
' S% D* T6 @" d' {3 pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
' ^& f1 d* l( K6 M$ m% U$ p, e4 U5 Y6 B- `% V+ o# k) o
Failed.');
# m3 e5 o9 P+ A7 n$ m}) u1 e. O( N! T2 [5 Q2 Z
Connect();7 i6 e* `) T8 W8 w! _
) d& I0 Z+ x6 v  {1 X6 b; C
function InitForm(){2 l; p  R# O1 C8 @! c8 @
//layout for the form
* G% W) Z: A( z3 Iecho "<strong>Send Items.</strong>5 `- P+ d2 `; i. O, _! ]) G
<form name='select' method='post'>: c1 a+ I! I. W" c" a
<lable>Character Name</lable><br/>7 P* b5 \% @' M% Y6 K
<input type='text' name='char'/><br/>! O- ^! w# x. p  v- U; {% f
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 [7 E5 E1 q/ `( g$ _<input type='text' name='item_name'/><br/>" Y3 D% J1 `8 b: X: E5 c
<lable>Item Amount</lable><br/>
% `, S  s8 z2 ]2 T3 O1 O<input type='text' name='item_amount'/><br/>+ v: _5 ~4 O+ k9 v7 T1 [
<lable>Item Upgrade Amount</lable><br/>
, n& h. c6 c% @5 O" [$ W; E<input type='text' name='item_upgrade'/><br/>
9 w9 _3 q' b4 \3 `<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
" |8 f; u4 A% V8 F2 x
2 `2 t# E0 N1 v( \8 y</lable><br/>
+ H  k6 p* h& n( ^$ K<input type='text' name='item_element'/><br/>! v5 \8 c4 l  ]5 E: }" q5 P: ^
<lable>Element Upgrade Amount</lable><br/>
  U8 l7 z+ s- H<input type='text' name='element_upgrade'/><br/>- U  N6 H/ b# p  }: t9 ~$ q
<lable>Pierced Amount</lable><br/>
- E0 J' T. ?" P8 X  H6 [$ J5 ?<input type='text' name='item_pierce'/><br/>' {7 A1 ?% {3 _: D; Y8 T" X: C
<input type='submit'/>
3 `2 j/ c# u1 h3 Q+ X; j# D3 a8 y</form>";% l3 @, A9 H3 m! T4 G
}
8 _& ^7 O. Q' ~( c( X( a" f, \1 C7 b' k+ G
function PostListener (){+ T# f; S' [+ \/ j
//Add more post variables if needed and add them to initform() function aswell; d! f  u& ]% [

  @+ ]: x. x8 y################################
* V" Y$ Y$ Q! L& f##### Connection and Post ######
. x: y  D$ Q& l0 j% ]################################
6 @: Y& B: j9 `  v, d$ i$name = @$_POST['char'];% W5 x$ x2 G0 A
$ItemName = @$_POST['item_name'];9 w0 n- Q1 u( K! B
$ItemAmount = @$_POST['item_amount'];+ F$ |! n4 J6 ?2 w3 |2 f. X
$ItemId = @$_POST['item_id'];$ E" k2 G/ }7 R! x
$ItemUpgrade = @$_POST['item_upgrade'];
8 R1 ~4 S; X# s7 J$ItemElement = @$_POST['item_element'];
' W3 Z2 @1 U$ R( W$ElementUpgrade = @$_POST['element_upgrade'];
" H- u4 v$ n" W) {6 j$ItemPierce = @$_POST['item_pierce'];2 e% {4 w  g) B0 Z1 T
################################
) V+ [1 v- T5 U9 T
, @) E) b5 x6 N; Q8 {//Check both variables for empty value4 S: x+ N2 ~2 `
  @/ c3 O. Y% W7 y
if (!empty($_POST['char'])){
2 h6 l/ _0 G- E  A$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 ]# s8 V4 }) x6 H; ?) a' @1 P
9 @) e# l8 |3 r8 V) k1 \, T( K
m_szName = '{$name}'");: \- u2 k( m$ h2 w: Y5 s0 b
while ($row = mssql_fetch_object($find)){
% T6 E% C9 r# p, Necho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";* z. N8 m# Z0 F  C/ V
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
3 }5 j/ s8 `7 E6 k$ Q3 Z) N
( P4 J/ F7 r, ~& }[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
4 g& q7 j+ d) d% w' i2 d$ {! V; \7 t) l; U* s/ ^8 i% R. r9 t
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 v: G+ t  U5 K7 ?9 w) g% e# c. g- \
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
- t5 F5 _6 D# _  A8 k8 \8 ^7 z' A- k. X7 B( M/ m; l$ L3 ^5 E* D! g
'{$ElementUpgrade}', '{$ItemPierce}');");" c7 G) o- V) w  E! V2 A
}
1 _# M/ a! y# A3 s( C" d8 u
+ V" `  `5 C9 ?" i, o% B9 ]+ V}  V1 H$ o3 p; U. s

& H( B" n# ?5 B$ M* [}& \9 ?4 U' h) M+ ]' \
; z+ D# Y  g* U
$InitForm = InitForm();
' r! A3 O  ]/ |" j$Listener = PostListener();
" y7 x4 D0 q4 d8 V, i1 I; H$ c% Z4 H& l
?>
: ?9 R9 D, \" f+ k
; c2 Y/ T% c1 ~4 o* O
$ Z7 [+ _4 O( X3 s! d6 ~: J# o+ L+ n5 t% @. Q
( `: |9 m, s$ A; T
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-15 06:36 , Processed in 0.070709 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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