|
|
<?php$ h8 v9 x) V' z. G& O; u0 N
function Connect () {, Q- F( z) n( h# Y0 A) r# E+ k, j1 |
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
: R |8 Y( R: j, o7 U8 E* S% ?, f5 u* n! d- ?
Failed.');8 h {6 p9 t- I
}
6 b+ R* r* u. H8 a! D8 g) X2 vConnect();8 O, ~. x1 @2 `3 ^1 Q8 D% v- ]
! K/ M, e2 D8 Q: Y7 N7 f6 Nfunction InitForm(){
( D/ x5 s+ m. s* j//layout for the form
* l4 Z2 R3 j/ G' Secho "<strong>Send Items.</strong> y X! i$ u+ w% x( _
<form name='select' method='post'>: K: U) F9 j$ O) K
<lable>Character Name</lable><br/>
. C, R/ L- j8 E# ~7 z<input type='text' name='char'/><br/>
6 y2 w; \+ w& N/ ?<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>' v! A( D0 h) P7 {# Q6 g6 U4 L- r7 C
<input type='text' name='item_name'/><br/>" o9 b$ r+ N1 D8 x/ f8 X9 V
<lable>Item Amount</lable><br/>6 U' X8 B# h8 ^0 P
<input type='text' name='item_amount'/><br/>
6 t, C7 t0 Q! r, N% M) ]<lable>Item Upgrade Amount</lable><br/>! f* c1 H7 z) N) [, w
<input type='text' name='item_upgrade'/><br/>9 v/ g8 D' j& v
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)% y- A# N9 K, c8 X$ L" J) m
: I$ v! z7 x) G1 G
</lable><br/>% v; H! _2 B0 w9 W
<input type='text' name='item_element'/><br/>
5 r j% s' @. x7 R& ?<lable>Element Upgrade Amount</lable><br/>
6 p! G+ R$ N+ C3 \" p<input type='text' name='element_upgrade'/><br/>% H* `5 X; G) S# f3 C' Y# s
<lable>Pierced Amount</lable><br/>0 a3 l' ?' H0 D" t" a8 v
<input type='text' name='item_pierce'/><br/>6 w: g s9 C9 j6 A% @8 y; _
<input type='submit'/>
( e% q T6 A3 g</form>";
- O& A( a" q$ m; I' p- T! \& e}
' m1 j( C, F4 p. f ?2 Z& E5 D: Y
+ U- ^1 }9 r5 I( m7 {) S* d- Lfunction PostListener (){
4 k9 j. r2 f% g+ u# b3 i5 x z* ?//Add more post variables if needed and add them to initform() function aswell
$ U# a7 ~" @" J, |
$ H3 ]( k$ r* B: D5 I$ I" l9 ~6 b2 b################################+ D! D- K3 l, g9 t) B
##### Connection and Post ######& f" _, x b% u8 `. ]$ ?. i* v8 M
################################7 I! h* K! S! X9 b9 S7 T
$name = @$_POST['char'];
2 W E" Y; i0 x# v$ x$ItemName = @$_POST['item_name'];* z& H) Z6 H! r# g; }! m
$ItemAmount = @$_POST['item_amount'];( a/ \' M) R9 W8 z, K
$ItemId = @$_POST['item_id'];1 Z2 K' F) [7 K( C- Y ^
$ItemUpgrade = @$_POST['item_upgrade'];
4 R. l& ]& ?5 U& f- t$ItemElement = @$_POST['item_element'];
3 k6 W; A1 h) p7 @0 x$ElementUpgrade = @$_POST['element_upgrade'];
5 F+ \& @( Z7 h$ItemPierce = @$_POST['item_pierce'];7 M# \6 Q, Y+ [! b6 u1 G
################################( K- k' @. T" q1 f( ]& N. c5 O1 k
* b- B1 w+ E! s7 x0 g; e
//Check both variables for empty value+ g" a ?5 p4 V$ K" `/ Y1 }; g+ \
4 u# I5 U- W, L/ Z* iif (!empty($_POST['char'])){
( e% s+ L8 R* Z* \9 H4 C$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where : r" [: P# G7 B$ {9 @1 O
2 C$ U: d# Z( G+ z* ?/ A6 vm_szName = '{$name}'");
, @, F* R$ b; A; p1 n8 l7 G$ twhile ($row = mssql_fetch_object($find)){
7 Q8 m# d% H; |9 j1 |echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
/ B/ K) }6 G0 D1 @$ W+ X2 _$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
& E( ^$ w6 T7 U( @3 ~/ D
( {- `4 I1 m1 D7 O+ F( ^[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
; A( A( i( v, d( [/ ^! e. }
- j1 c& r& _; u[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 j; \$ R2 p' W& c
4 H$ l" Y/ O8 P X" zN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' P$ ~* A" P( K( C4 P& I
0 U1 H5 b6 C' g8 c
'{$ElementUpgrade}', '{$ItemPierce}');");
, F- ~% ?/ S$ Z/ U2 I}" D, u( z+ O8 [0 m7 P- E
( _, t# b( h" v6 j( R4 {0 z}$ ?+ n; \, U: L. k
9 ^' u2 ]8 S! \) n; Y" y$ `5 e
}( {* p: t2 H6 z% P2 u- M
2 D, W& t: a+ a. T
$InitForm = InitForm();% _( A; }; G+ k/ P* w F
$Listener = PostListener();8 `" _) D3 Q- n& S6 f' r) f. t, Y
+ ] W+ T7 P! O/ I0 M' R! m
?>
- y, C9 B& E C( |: j' {: u
( {" ]" H T5 C6 s. T
3 M! X" e3 h+ O) F, G8 K
" h% R: E# c9 O/ u c
1 k2 L- t. _- E; c9 P, n. e4 ]3 r |
|