|
|
<?php7 v6 P3 Z& ^: I
function Connect () {7 i: f. i" H! ]* g* {6 L* X7 @6 x
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
: m# _5 @" ?6 q2 |% e4 K. h2 ~
: U K) D& j3 dFailed.');# Y8 a7 S: j- s3 Z F0 a* P
}3 ]1 D# E+ C& k7 }
Connect();+ Z: k6 {. _7 j+ K) ^. z
0 p9 _- c% `4 i6 c g: d: y
function InitForm(){
% b' C" o' R& q& S5 _0 W//layout for the form; m6 z" }! W- W2 c, d
echo "<strong>Send Items.</strong>& }3 Y, S# p- c
<form name='select' method='post'>
: r' w O, J% T- Q9 B' @<lable>Character Name</lable><br/>6 X- y1 \+ \/ W1 ]- l9 a# k
<input type='text' name='char'/><br/>
$ i* B( x1 N% b3 U* S/ S<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>6 b4 l* W+ T% N/ w
<input type='text' name='item_name'/><br/>0 f- Y/ Q) ?, j+ N/ D6 Z
<lable>Item Amount</lable><br/>$ E" n2 t" u3 }9 }8 _
<input type='text' name='item_amount'/><br/>" k% t4 ?0 W2 L- x( m) y/ m
<lable>Item Upgrade Amount</lable><br/>
5 f! y$ t0 D) W2 v8 [+ V# z0 N<input type='text' name='item_upgrade'/><br/>
' O6 v. \" S7 W. H8 R<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)" r( N5 n( p) O- [) |
9 \! _; _! p! L
</lable><br/>6 _0 p9 r0 ~0 X5 Y: Z0 {6 X' i
<input type='text' name='item_element'/><br/>6 F. K) I3 [% Z1 S% I" x
<lable>Element Upgrade Amount</lable><br/>
" N5 J' n0 I0 }7 @; P; y<input type='text' name='element_upgrade'/><br/>
0 Y. L" {5 w v$ T# ~* b<lable>Pierced Amount</lable><br/>: P' ?+ G3 Q+ i+ }/ x* p) z% g
<input type='text' name='item_pierce'/><br/>
* b7 L/ u: m7 l7 I( A9 n4 U<input type='submit'/>, s" A3 [1 B$ n
</form>";* m% F3 _: e6 }- O3 A
}
I' E3 K3 [. p6 Q' u3 R
1 _3 [# p+ x1 N* @function PostListener (){
3 `7 m! G- M' P//Add more post variables if needed and add them to initform() function aswell6 i& M/ K, F1 q+ O
: |& m% ?+ }6 @% q0 F################################
1 E9 r% x: G6 p8 W7 t2 ? Q##### Connection and Post ######) n: K* z [ C6 T6 H, F3 [4 q
################################
, x6 ~% u$ Q4 n4 ^4 v3 H& C$name = @$_POST['char'];
( {* { C- p! A4 A# S7 Y$ItemName = @$_POST['item_name'];
$ T, }) x- w* p' \. {& Q1 Z$ItemAmount = @$_POST['item_amount'];
B) O$ z' }( e7 r$ItemId = @$_POST['item_id'];
8 |- P% c% I+ I% J3 B) l$ItemUpgrade = @$_POST['item_upgrade'];# w9 U/ A$ o, \5 r/ j9 Y
$ItemElement = @$_POST['item_element']; T+ \& |" p. x T4 {3 V5 o
$ElementUpgrade = @$_POST['element_upgrade'];
+ L3 ~% z; X# x& K$ItemPierce = @$_POST['item_pierce'];
: l5 ~1 D! d9 H$ q7 e0 \, i################################" a- @* ]" ]/ C) d% [# ]
. r6 J" ?. r2 T8 M; ~
//Check both variables for empty value6 q2 P: H8 W0 P, C. x, Z, o9 n
" K `" h9 p8 E" h) Aif (!empty($_POST['char'])){
, i' z3 D: L' s8 @4 I$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where - G$ s8 u; \( ]% R- q, @
8 f3 p. B, m5 q. Q
m_szName = '{$name}'");
$ m+ X! w2 {- }9 c9 n9 [& j1 K/ mwhile ($row = mssql_fetch_object($find)){8 F& i) \. r t
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 n$ a! L N- F% @/ m
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; o6 x& q; N/ E+ v! e7 V( ?+ g7 Q. G
, }+ J) x( F6 V/ h[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
/ F1 v) B5 h+ C7 O. |0 H2 m n* @1 t a! V; l$ ]6 W) e9 m3 I8 C
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; f) A% t. U1 h/ D9 y, z) u
6 S) [; Q- t$ s# E4 d% gN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
) v/ i* F/ l" t, a' p, k2 r$ U, g! {3 O( l8 D3 q0 [% i
'{$ElementUpgrade}', '{$ItemPierce}');");
0 {# n n8 v4 o7 C" b7 o( W}2 O: o; @" V+ N' S
" |! Q$ q6 D0 O q}* |1 w0 r; g$ v6 p f
6 h6 h8 P* V! u+ A9 c; x}
0 Y2 ], @7 n0 O. o) ~8 ]) b4 Q9 b) e
$InitForm = InitForm();' d; S$ |- c, ^* x. m
$Listener = PostListener();
! G" F% t% Q h% v3 A8 d* v# l; x; f" y1 k5 h5 q" e0 k& U7 P0 ~2 `
?># p ~( f9 J; v
- ]8 o& W9 Z- i& V4 p2 E$ L+ [
2 Y. x. ]! S7 r8 N. w1 \# ^
) G, y( Z. f9 S& v
. h2 n! `8 W6 R5 A! Q |
|