|
|
<?php
) C6 D; F+ ]) G6 I* F0 `function Connect () {
+ {$ A4 n3 W' {8 [. }$ h8 emssql_connect('Server','UserName','Password') or die('Error: Connection to DB
" ~7 ]8 }+ ?% L# i q j" R, h' W. a
Failed.');1 F; c. f. f! ?! C; O W
}
. x4 I9 m: {7 d( u( }' o; ~7 MConnect();
: a2 \( r k1 a m. f" t! o8 O/ @/ c+ c& }* W5 A7 o; T; Z
function InitForm(){
9 C& V9 Z/ B& H6 b6 _//layout for the form
3 g! b* P) z- j- \0 m U8 _echo "<strong>Send Items.</strong>
; l# \: H0 y' P4 H( Z6 Z8 ~<form name='select' method='post'>5 Q+ `- Q# k5 P8 A% Q2 P5 V) `
<lable>Character Name</lable><br/>
6 G+ c0 E/ Z/ I2 g2 m+ Q<input type='text' name='char'/><br/>
# ~/ V7 g4 c( p- F/ U! v2 h8 [<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
: K( e- j; ]3 W T<input type='text' name='item_name'/><br/>. N0 u( c S' J
<lable>Item Amount</lable><br/>
0 K) r: T$ _ u<input type='text' name='item_amount'/><br/>
# x# c. d# k: j/ |: _<lable>Item Upgrade Amount</lable><br/>
8 `& r3 e% a. y; e<input type='text' name='item_upgrade'/><br/>" v; Q/ V) n0 a! ]) i
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
- ^- r% ~6 C# {2 G* `1 \7 |" {& w$ |4 H6 S9 H, F& E
</lable><br/>
6 J! [; t( k7 S4 R<input type='text' name='item_element'/><br/>. k- C# {& w7 L. A* x% b, E8 Z
<lable>Element Upgrade Amount</lable><br/>& N% L/ W" K$ e) n1 c
<input type='text' name='element_upgrade'/><br/>
" p! g* S% [& l' N1 u/ Y<lable>Pierced Amount</lable><br/>
7 G7 N$ v, U% E Z<input type='text' name='item_pierce'/><br/>
! U% E/ K: E, x: q3 s9 I1 E<input type='submit'/>7 h4 D& m$ O7 Z- ~( w3 o& g3 t
</form>";' e- y6 f. V" B4 B
}+ z/ G$ v, P4 z0 [2 c+ W3 [
$ _5 X, N' P) O- C3 H
function PostListener (){
& p; j5 }( N9 w& }3 }# [//Add more post variables if needed and add them to initform() function aswell
9 \# Y1 `: O. U4 E* c. o9 z) {: k: y# h& g
################################9 K7 A- _; Q0 I% |' ^: z# m8 e
##### Connection and Post ######
3 H5 M! Y+ u) M1 P! l################################
$ U% | t K- \ B- g% b4 ]' f$name = @$_POST['char'];0 y( U/ y8 D2 ^4 ?9 {+ i
$ItemName = @$_POST['item_name'];
; ^; P' U+ d# l7 a+ w1 q$ItemAmount = @$_POST['item_amount'];* C& J5 C3 D3 I6 F. X& ^, ^
$ItemId = @$_POST['item_id'];8 i* _; ~7 x, h7 ]& K. L
$ItemUpgrade = @$_POST['item_upgrade'];
; `& [9 T( a9 A7 }$ItemElement = @$_POST['item_element'];8 ?1 S+ ]& l. W( m/ N5 r
$ElementUpgrade = @$_POST['element_upgrade'];: H. K' U l. X+ L
$ItemPierce = @$_POST['item_pierce'];
$ S6 \6 b( |$ j$ l3 H; c################################
( |4 l# L. a) q9 c- ?, U6 H" R7 G Z$ Q6 \
//Check both variables for empty value
8 l2 o! L. @6 b0 X3 e. p4 s$ Z, U6 c6 m! M
if (!empty($_POST['char'])){
, ^% Y: S7 C. t: a$ a/ S$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
1 T ^( x: j# t) k) I8 a; I) ] g4 V0 X. x n8 z
m_szName = '{$name}'");
* t' k; ^# f' q! H, f5 R' mwhile ($row = mssql_fetch_object($find)){
7 Q" I- G9 ~8 k _7 `0 yecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
9 O- }2 h+ E1 d6 \$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 3 T8 i4 q) [; }; W) w
: p7 k% q8 _/ ^% u( {3 U. C7 _ I[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
+ f( U: j: T9 _% E, A+ Q) x S
6 R! q: k! ?( I6 r/ F6 a1 p; ?[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
! C0 ]" A) Y" F( p+ }) l
& j4 Z! l9 W; ~N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ^( u3 r6 ^0 r! b! P) g6 A p0 U
, Y" ]/ S8 v1 ^5 E3 r3 h
'{$ElementUpgrade}', '{$ItemPierce}');");
0 ~7 j" A' n- Z4 n}6 W: ~6 `* E* p9 P5 F) s
( x$ @2 I1 ~* C* G. N& o
}
6 |/ t: B( ? n1 f! Y! G
4 K7 _, w$ Z4 P, y5 @}
) M& Q: g- U1 z% o& \( ~
; H4 b- `. A( R3 a' D/ m( j$InitForm = InitForm();
2 t) S2 }( e0 O/ d% X( C" O$Listener = PostListener();' @) Y# A @2 S3 h* \
2 i1 u/ m. W% ?2 T# E1 |
?>
& O7 \$ G) r- y& o
1 v0 v) l( ~0 o/ O g' G
, d& ^3 \) R5 W! ^: ]
! J& ?. _ ?# u
0 a4 i, e/ @& S& j- j4 b |
|