飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php# ~( L  d0 ~& t1 @: K
function Connect () {
/ `# a) K0 V3 gmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
- L7 x' C7 x+ V, b  x
# E! {3 E* e+ P9 TFailed.');
& a& @  ^' f: J$ E2 {/ f# ~  e}9 F) q4 a) i2 D3 `
Connect();
6 t# w& T  `! B6 M$ C" q4 N3 u; N* @( y% E& j3 l, p
function InitForm(){
3 ^+ n2 x, c9 @; {//layout for the form2 n+ \( Y$ n0 }3 B1 h/ R! i6 |* p1 g
echo "<strong>Send Items.</strong>7 l1 f& |+ A& t: v/ e1 U. [1 k8 ]- m
<form name='select' method='post'>
/ H2 s' d4 ?- i<lable>Character Name</lable><br/>% u! D: d% l7 K( J9 _
<input type='text' name='char'/><br/>
1 p" _/ i* e  o6 j- b6 L" l/ z<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>. a9 }& n7 N( S8 i- J/ u
<input type='text' name='item_name'/><br/>* h' Z) a5 D5 f. v- I0 y4 p0 Q
<lable>Item Amount</lable><br/>  k  y: m6 X+ s! T2 ?
<input type='text' name='item_amount'/><br/>) A8 U6 {0 M% ]3 m
<lable>Item Upgrade Amount</lable><br/>
2 `1 |( b3 ^8 |3 g+ k+ C<input type='text' name='item_upgrade'/><br/>
0 [5 E" m) K) h" @' z+ q<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
, T, x1 @( R. Z1 b3 U- B9 N* @. x0 @+ t6 }
</lable><br/>9 p' c& z3 j7 B0 D! {
<input type='text' name='item_element'/><br/>5 x+ b6 `% f; a! m
<lable>Element Upgrade Amount</lable><br/>
+ z/ Q% }( w6 ?<input type='text' name='element_upgrade'/><br/>( I9 ^0 W! k0 f8 W+ Q+ K
<lable>Pierced Amount</lable><br/>, h* J& i) v  W2 o
<input type='text' name='item_pierce'/><br/>
; e+ U( u& B; v) g! A) a<input type='submit'/>- l4 c  M/ N+ ^$ J! U/ e
</form>";
  u, P% s( P/ t3 e" i! j}- w$ {, G1 C& v0 `
5 z1 f7 `1 c5 t6 X+ g1 i
function PostListener (){) b  b+ m& c8 f% K/ O7 O* ^
//Add more post variables if needed and add them to initform() function aswell
7 Z% r. p: D4 V% \3 |5 U8 f' r1 A+ m3 b
################################; j% r/ U6 P+ T+ }1 [. B: M
##### Connection and Post ######
' r  {. c% z) \  P. d' r################################
9 u# O0 z& g' e+ x  t, g4 @$name = @$_POST['char'];$ O+ U# F3 F0 `" Z! }
$ItemName = @$_POST['item_name'];, L- {4 U6 {9 D0 \! x2 r: `
$ItemAmount = @$_POST['item_amount'];& B( ~" A% |" O' f2 w; N! M
$ItemId = @$_POST['item_id'];
8 Z2 E2 a# Q0 ]; `8 y( {$ItemUpgrade = @$_POST['item_upgrade'];
: a+ w! r; n# f* m$ItemElement = @$_POST['item_element'];) p0 r9 a" ~4 y! M$ }
$ElementUpgrade = @$_POST['element_upgrade'];* P- S3 h1 a/ |5 z4 ~
$ItemPierce = @$_POST['item_pierce'];' U4 I! T  n: m! q9 B
################################
$ Q1 _& C& {, h& t; e" u* r8 D- v2 c6 {
//Check both variables for empty value
" O1 M4 e$ i# z. `. \, W' V- u3 p% Q0 ~& @- C! J
if (!empty($_POST['char'])){
1 o0 m. m+ ^% X3 `' M/ Y$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
4 V& w, g; V/ H( n7 _8 [. k
6 E5 b* v* |6 I6 }& {9 E' tm_szName = '{$name}'");
" G( s% F) i; t7 ]while ($row = mssql_fetch_object($find)){
" d9 A0 t; Z6 D$ Z" cecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
! ]% H4 f6 Z" y" i$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
( ?* m( D* a: l  l4 [4 h4 _6 g
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ! g; }; y* i& [: u2 \7 x

$ r; |. V' y9 M' I6 k[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
+ |) Q& v  a, e7 Q' D+ Q
* L( E4 Z$ N, h7 Y$ q1 \) o5 gN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
& t' m( n  r# r/ k. I8 i; u& F1 _$ J9 c" _' M) _) t
'{$ElementUpgrade}', '{$ItemPierce}');");4 f/ B  a# Q0 I3 i+ \
}
1 m- e# n& P- J8 m: W$ e' }1 D/ V; G5 d6 m3 |
}9 {! q  @- f( [
- M# m: _( d- x$ g+ n; t
}
5 {) u  S# u  m; G) z6 H& y7 u' C8 @3 O6 Y( o  F
$InitForm = InitForm();( D* \4 t' L* e2 [* s- V, }3 x9 f9 x
$Listener = PostListener();
0 Z/ y1 z5 \* u
/ [- M7 `: C' ~6 C* v2 N?>
. c  q* h% {% B) I" a' a/ e5 o0 h* g  P' _5 L( ]

" E7 f; D3 ?0 I* q8 \; Z- ?, e: ^" b
( T) c0 F8 a8 n! w
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-1 23:00 , Processed in 0.063854 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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