飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php! `; U5 _/ b3 C6 V
function Connect () {
/ w0 U6 \0 ^4 N$ j$ Emssql_connect('Server','UserName','Password') or die('Error: Connection to DB " ^' o+ X0 \$ A3 G  r

0 H( u' c6 g3 E+ j2 Q  zFailed.');, B/ A( w5 m: X3 F4 u6 Y
}/ s2 M$ b% J2 U8 c; N' q2 z
Connect();1 d6 y3 ]4 t4 W9 F# X
" v# u. w% Y  z- k" }" [
function InitForm(){- M- W& A1 `" Y" {
//layout for the form  E6 Z1 J2 F% C+ c( C+ \
echo "<strong>Send Items.</strong>
$ W4 Y( P! @& [<form name='select' method='post'>
8 R4 U: G: }+ @" b<lable>Character Name</lable><br/>0 W2 m; E1 P& y: e
<input type='text' name='char'/><br/>
$ b+ V$ x2 g% W* Q( c<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>6 N3 Z5 l7 l! ~7 f
<input type='text' name='item_name'/><br/>8 H+ I7 ]5 o9 ^. }
<lable>Item Amount</lable><br/>$ l  k7 ^% j+ ~$ t7 ?# z
<input type='text' name='item_amount'/><br/>
, Z! H; ~( t& F. a<lable>Item Upgrade Amount</lable><br/>
# z% Y4 m! o( V( ?) q<input type='text' name='item_upgrade'/><br/>
  n8 J! o4 x& H. d<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)' m; r* b. E% U9 c" v8 @$ v

* i. J, h: f" G) p* j2 M8 t  T</lable><br/>$ [) c0 \) }$ K* c
<input type='text' name='item_element'/><br/>
, U% b" V+ `/ C' G2 c8 z3 P, R! ?<lable>Element Upgrade Amount</lable><br/>
# n7 ~6 g% p7 `; p' w4 z0 u  Y<input type='text' name='element_upgrade'/><br/>
8 c" `% O' w6 e5 l+ Y- N<lable>Pierced Amount</lable><br/>: Y, S7 d, z1 t; r
<input type='text' name='item_pierce'/><br/>( C, r0 s% X+ c
<input type='submit'/>- o% o& x0 C. F  }( X3 [  v
</form>";, Q+ E9 J7 K$ |; u, x: d# `/ m. B5 n! X
}/ F1 Q2 g- E1 p* Q' A; u
8 u3 P/ y8 \! K) n" \
function PostListener (){
% K0 Z3 O4 O* t* {* t/ D//Add more post variables if needed and add them to initform() function aswell
; L4 A1 s& Y9 `* A) M! @( A6 k' U( z7 {
################################
- s7 m, d( V* ^0 P- D##### Connection and Post ######
. V. W2 m' D* W################################
" [6 M. ?% H* I9 ~: P7 Z! z* b$name = @$_POST['char'];( Q$ G2 @7 H" p9 ]
$ItemName = @$_POST['item_name'];
6 V( `0 \- l+ C. u  C1 _+ N$ItemAmount = @$_POST['item_amount'];( N! k+ [, c0 Z
$ItemId = @$_POST['item_id'];
8 z' x! ~9 E8 f0 z8 d6 }$ItemUpgrade = @$_POST['item_upgrade'];9 r/ e. l* t3 Q
$ItemElement = @$_POST['item_element'];( Q1 E1 g8 z0 i
$ElementUpgrade = @$_POST['element_upgrade'];
% i% t- [# l+ x2 l0 g5 l0 U$ItemPierce = @$_POST['item_pierce'];0 y/ K( K- r9 m, Z
################################
# j& `% U9 S. C8 j5 L# t8 h* B( m& ~3 w* w& [8 W9 k% w0 v: C/ _# S
//Check both variables for empty value* @* n8 Q; [, I1 _" j
0 |! Z- y% X1 Q- {
if (!empty($_POST['char'])){
" J; v7 L! {/ G$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ' X+ W/ l5 g3 K" [* F- A

4 A: g9 M0 h) G& j9 Fm_szName = '{$name}'");3 v* }& T6 x/ n* a# w  t' l1 R8 P
while ($row = mssql_fetch_object($find)){
5 T, G2 r. s$ ~& ~4 Secho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: c# B' ~! n$ K  W" V+ v$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], $ m# @- c9 s! n* f; ]8 ^

+ ^5 N7 i5 {5 d[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
$ R3 g/ s% n, [" z9 x- Y% }; p' E
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
' u; Z# e6 [  i1 |6 A* g/ U: ~3 X9 o! `0 W! J' R1 h  v
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', + B5 b. `- a/ X; v+ G2 T

. x  N2 [! d+ A3 w, l" }& D( L'{$ElementUpgrade}', '{$ItemPierce}');");
! {) E: j- P) G' X# q# s3 W. T" j# P}
# d" E) X0 p: s+ `" z! L( J% L9 `1 G- y
}  i5 h5 u+ K( q0 d4 @1 U
7 r- s+ N. d3 m! |* m4 ~
}
& B, X% m/ Q# S" z) Z4 G, ]- p: E% q! O2 m8 _! K# m
$InitForm = InitForm();
. i; U5 m* R  K7 g; S% F$Listener = PostListener();
: |4 k  B- g7 C* X- ~5 |" A/ V: s1 C& E
?>/ h5 _) n& o" P1 t" Y
7 d5 a( k. M/ D/ [3 h
1 w+ Y9 N, t3 Z, G' ?2 Y
8 m2 X5 b1 ^: q) d

; h8 S# F' z% h+ v
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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