飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php
: j+ G% ~/ m2 I" Jfunction Connect () {
5 x2 a5 s& x  O; C/ a0 Ymssql_connect('Server','UserName','Password') or die('Error: Connection to DB ( u  Y; M8 N6 }, Y) c8 e

* a6 S, ]9 B' i! }1 `# S* ZFailed.');) p6 u" s- {9 G+ j4 i) a/ b
}5 ^) |! U. n: w, [* r& t
Connect();7 G% F# u+ e$ r, M
& H+ g  T3 P( f8 h5 O. b
function InitForm(){
6 G6 Z5 r% P. r' ?, Y- d# P//layout for the form* q# e4 Y- c1 ?7 S) S. W! V" x
echo "<strong>Send Items.</strong>* p. O! t$ W1 C2 O0 l
<form name='select' method='post'>9 @# j6 \0 `4 n1 p% {' i
<lable>Character Name</lable><br/>
$ d: I1 I4 v. q9 ^5 g4 Z<input type='text' name='char'/><br/>+ r# h/ _5 Q; I: u
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>* I  e0 I& D5 f: r3 t
<input type='text' name='item_name'/><br/>- X- x  s+ u5 S& K$ {/ E
<lable>Item Amount</lable><br/>
8 }4 ?' n/ j5 M2 s<input type='text' name='item_amount'/><br/>- U6 x% j! p1 P7 c" A
<lable>Item Upgrade Amount</lable><br/>1 a8 ~; M9 g5 ^/ n) w+ |
<input type='text' name='item_upgrade'/><br/>1 R0 c/ B+ z2 C8 S0 [
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! f& B6 u: J0 Q  f" T

& }0 ?* E& B( ]8 s9 W1 y% _</lable><br/>
+ S- }& ]- M2 r, z3 I<input type='text' name='item_element'/><br/>
& @  L  {% ^+ \6 I5 v<lable>Element Upgrade Amount</lable><br/>
8 E6 L" U0 F) E7 P<input type='text' name='element_upgrade'/><br/>
7 e  }( Y+ }3 J8 d% |; ~- ~<lable>Pierced Amount</lable><br/>* f# W* N1 x0 Y! M+ I* F! ]$ ]/ L
<input type='text' name='item_pierce'/><br/>. E9 a0 ?: m1 ^' s! A
<input type='submit'/>; D  w* A- U+ S* H5 P; W
</form>";
) j! Y( }8 I" P0 `1 d1 T( k}1 g7 E' m# n, o4 U' u
- {% I/ u5 |5 i8 n: `$ k
function PostListener (){
6 e8 k5 s7 s* ?: }2 L2 F//Add more post variables if needed and add them to initform() function aswell' T8 ~0 Z$ x0 b2 x% x  {1 j0 |
/ L9 U4 X# ?( {: F* x- H
################################" a8 ~1 w$ ~: s6 j" Z0 P4 H8 G, V
##### Connection and Post ######
' K, b2 j4 F! O# L5 k/ g3 N& ^################################
% d! k2 o  \, G& f$ N+ [$name = @$_POST['char'];" X$ Z# P7 [5 U
$ItemName = @$_POST['item_name'];- i1 z* b* `" R( @5 Y3 R
$ItemAmount = @$_POST['item_amount'];6 b2 \3 u) F6 P% n
$ItemId = @$_POST['item_id'];
0 a, J: n6 d( P  ?$ItemUpgrade = @$_POST['item_upgrade'];
; P8 d, U' {0 h+ ?+ }9 z3 }6 [$ItemElement = @$_POST['item_element'];
) J6 m# _* @0 `$ b3 t$ElementUpgrade = @$_POST['element_upgrade'];5 ^: o  x% ?" n; I- p' `
$ItemPierce = @$_POST['item_pierce'];# p1 Z) v$ K( Y' I
################################
: U" P$ K$ z  \, n/ f) G* p2 G; Y4 X* D1 p) f+ M
//Check both variables for empty value4 E* C# W& h5 j% i5 y* t
" Q' S0 \6 V& w5 I& R2 H
if (!empty($_POST['char'])){
4 g$ W. \# Z$ z% `4 L3 u: P$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where . E8 b6 \0 l# @

. ?7 A. h: X) f- @* j$ {: a, [' Tm_szName = '{$name}'");2 {9 z5 @( D  T4 N' H' k9 ?" D
while ($row = mssql_fetch_object($find)){) r$ i7 P3 z  F. S' g
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";, Z# b# \+ M8 k# u
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 5 \& c1 }+ w* i- g$ `

4 C# [& `! n  l) F[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 2 U# Y" r/ K4 H+ o& F+ t' z9 A" p# s
6 S! V5 o  U6 o: B8 O
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', . c6 x; L$ P' @: _+ P6 h8 P5 \5 g

7 S" r8 J$ v% s  KN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
+ _2 L4 H9 ]9 T! {0 n3 V( z/ ?+ N! `" F3 p* e5 y' D
'{$ElementUpgrade}', '{$ItemPierce}');");' D+ U& i2 Y5 Y- S8 j1 G! q
}
9 f' n1 ]& a8 j  T. E7 {
( n$ y( J% ^  p9 L- p}& ?. s0 e( M2 n' `, I! w
$ q. j3 A8 [* I) R  B$ X
}# x1 }# B# c2 f9 w7 s
2 i* Q) {3 j% K# K4 O) ?& u: P
$InitForm = InitForm();
! l* ^9 p# n8 S4 q, w. T8 l$Listener = PostListener();, b7 {% d9 q0 x2 C; A* F" T

, s6 L& R/ m) ^- c?>
7 Z, t# t9 k; B* C" @% W3 Y& Y: G  a$ S5 G, g

; j$ Q7 n* j4 t: `$ M* J( M
4 X# C4 _5 |  m% z! u* F; v/ q3 f
1 ?6 m! d- l( j6 n, Z& M
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-18 03:49 , Processed in 0.060739 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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