|
<?php* w7 o( q. }* x: Q" w- q) A0 R2 k
function Connect () {
" E2 V( X; q5 a+ o4 J& g; mmssql_connect('Server','UserName','Password') or die('Error: Connection to DB . w! _" ~- s5 l8 |( p2 n9 V6 M9 A
/ U) H5 W \" W% B9 O& N, ZFailed.');0 q8 c4 G5 e9 t- W# q" \
}6 j9 F% a0 @( m# Y/ c/ S( _5 a
Connect();( q# y' o$ B( Z/ @# X2 w! b
( @, X/ H8 H* g9 G, |
function InitForm(){, w- e( g3 l& Q; x9 X
//layout for the form
- Q' P- m% o) Y! Y# z3 qecho "<strong>Send Items.</strong>
( Z3 j% M1 u* U$ G7 [<form name='select' method='post'>. j$ D1 S( {5 I/ M4 a
<lable>Character Name</lable><br/>
7 R2 D. J& H( c: G+ K6 ]<input type='text' name='char'/><br/>, z# `: l, T. m u
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
- y4 a* a8 p9 y' K8 M t<input type='text' name='item_name'/><br/># e, h( P2 t. @3 h5 V
<lable>Item Amount</lable><br/>
) A t& e( t( z E+ A8 \<input type='text' name='item_amount'/><br/> d& u, G' j- R* }
<lable>Item Upgrade Amount</lable><br/>: n6 J `& }3 Y+ C ^6 o
<input type='text' name='item_upgrade'/><br/>
8 {& e, B: h- l1 s<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.). k8 H; B3 Q: U& w4 g
; y: _% O: s2 Z: l# a
</lable><br/>
6 x, q. \+ k) S. \ K<input type='text' name='item_element'/><br/>
( m$ K" p: d0 Z# F6 y* `7 h0 a<lable>Element Upgrade Amount</lable><br/>" ]0 L' k# D$ ~& p3 O3 i; k0 r" G
<input type='text' name='element_upgrade'/><br/>. X1 w1 d; J. |
<lable>Pierced Amount</lable><br/>' q" W& h! r- {5 o9 @
<input type='text' name='item_pierce'/><br/>
9 N+ u4 e8 C4 l) Y4 M# m( U- \<input type='submit'/>
' @" }; Z) p9 w5 e</form>";
- }0 r; d: V, z G3 `}9 O! q. X# w! q4 X
1 k+ Z% J0 L% \5 f" K0 B @" |function PostListener (){, w8 p6 {( x$ O' N, ?! T
//Add more post variables if needed and add them to initform() function aswell6 O: `: m F& X; G/ T
7 J' L( \9 W0 ^5 V
################################
: q8 d! w% L4 Y( x7 T##### Connection and Post ######
2 Q! q6 \. _( h2 ^& E0 j################################$ o( t: F1 Y4 U8 z- Y
$name = @$_POST['char'];
* E& X" }) w; ]: E4 _: G1 N$ItemName = @$_POST['item_name'];
. h8 b5 O8 P3 _# M# X$ItemAmount = @$_POST['item_amount'];) h0 e' U: \3 I* V4 Y; E- a
$ItemId = @$_POST['item_id'];1 a T( v9 t7 M7 i4 d
$ItemUpgrade = @$_POST['item_upgrade'];- \$ q/ @8 g& C9 O
$ItemElement = @$_POST['item_element'];
1 ?& i# o F$ |5 ] x$ElementUpgrade = @$_POST['element_upgrade'];6 a/ @; o5 `5 @* u1 S: J. O
$ItemPierce = @$_POST['item_pierce'];& n3 S* @5 u) ^2 V- e: I
################################( C$ ~/ ^' O% S9 |5 S' W* W% r+ {
3 J' w |, u1 j+ ?4 \, w//Check both variables for empty value* n. @4 ~+ `7 X* x$ g& n
8 m! W s8 d, Aif (!empty($_POST['char'])){
0 Y; Q3 Q3 k$ W3 _! y$ w% h$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, h! X; t0 |2 d0 k" F$ B9 T5 s4 x- K
m_szName = '{$name}'");
( m6 W7 @- K9 q0 u/ @while ($row = mssql_fetch_object($find)){3 I3 u, s; h1 ?: B. D9 k1 A9 ], v, o
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: \/ S5 R; [$ s7 L& \8 g: J- h$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
/ X' W% C; A G! S5 K# k- q7 ~( h0 ]( T7 a
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], * R6 a& v% G6 i- F" F8 J' V x: d @
. r- ?1 ~+ O. C1 `, h[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', % b) ?2 f$ ]+ I$ {( l& Q" q
$ h0 l! D& {$ [- F0 z MN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 ^4 F8 r5 k: x+ }4 |+ U u
7 v2 @+ i3 R* w9 l! K4 F/ m8 G'{$ElementUpgrade}', '{$ItemPierce}');");% X) @) y4 O9 `8 o
}; p2 f1 }% f5 j" L
8 z) m; O$ x' y3 Q$ Z! t3 S% L! O* R3 p6 M
}
' ?( P9 E7 Y" P
1 [9 J. R5 `( ^: Y/ \& x' U}! E( Z3 f$ { F
2 z1 O5 g) e5 L6 M( X* B$InitForm = InitForm();9 u" x! _: v# q- B/ [3 O; b- S
$Listener = PostListener();% O: d- q! o1 L& z0 ]
. k; K& g( t7 L! m8 P
?>
Z1 p" e) _/ r4 r& F
8 Y& G7 K. w2 ^5 S$ t# O/ n4 U& p2 q. C' v# V
- H1 V y. z% K4 Z7 R1 p3 p( D
6 k( V; R5 v/ s9 Y0 g |
|