|
|
<?php
) _8 |0 I4 P, Z: j9 ofunction Connect () {6 q& Q& t }! Z, `. x% I9 c
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
7 W2 i5 u8 a3 ~) @! H4 D" s8 d6 o
Failed.');
; [. D( @8 Y6 f0 P1 G- t$ K3 c/ z}
$ z5 S- I E# m7 fConnect();. [! @3 w7 c4 F7 Q
( ~* y Q6 x0 G6 O; ]# \
function InitForm(){6 [7 U9 r' X v; W& @
//layout for the form
" p" Q7 _ R- O, i( Mecho "<strong>Send Items.</strong>2 m1 Z* b+ y: o' H C
<form name='select' method='post'>
( u# C: {1 E6 Q) f8 ^& O<lable>Character Name</lable><br/>
. _8 ?- g- F- z& S<input type='text' name='char'/><br/>
7 X! U" s6 o! \1 K: [<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 m& x; [- O L3 y( z5 |<input type='text' name='item_name'/><br/>
+ [/ ^8 M+ ~, b0 d1 [0 R" c1 h<lable>Item Amount</lable><br/>
w: M7 V: ~+ ]9 Y+ f<input type='text' name='item_amount'/><br/>0 s) I) n2 L" l
<lable>Item Upgrade Amount</lable><br/>: N0 O/ F$ G# E
<input type='text' name='item_upgrade'/><br/>, o( Y& m; R8 O/ g5 d7 Z' E8 b6 ~
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.). w. \% A3 C9 n# ?
% U; u0 U# z9 \# y: P( R7 o</lable><br/>
0 R6 G- |0 w9 |) W+ m8 V% I<input type='text' name='item_element'/><br/>% }" E1 n! ~, U) I$ f
<lable>Element Upgrade Amount</lable><br/>
. G; x/ }. N& F+ G<input type='text' name='element_upgrade'/><br/>
% i( ~& w) C0 e% i$ B& B4 w6 j<lable>Pierced Amount</lable><br/>
4 `9 _6 D c2 R( i2 F<input type='text' name='item_pierce'/><br/>" n4 t& G1 Z, B9 G
<input type='submit'/>
6 F# e4 h( x8 U</form>";
5 M, k# z9 s; Q( u. `6 s2 M}
) ? u A( G0 b. ^6 D/ o& ~. `( Z' g* N# y
function PostListener (){2 x; O" a& |. v3 }
//Add more post variables if needed and add them to initform() function aswell2 [& A4 j4 S, D( U- d! W$ q( G
7 N/ J, K4 V s9 ~3 B- N( O
################################% p4 J8 X. e. }- q r
##### Connection and Post ######
: z# a! R; ?7 Z% _/ d################################2 E2 ]6 ]4 _4 y N8 ?7 _
$name = @$_POST['char'];# {. I% R* |$ D0 m: d% z! r6 P+ @
$ItemName = @$_POST['item_name'];
4 {1 X$ x6 X! ] F% Q" C/ |0 u# l$ItemAmount = @$_POST['item_amount'];
5 f/ {- ]& D, n! V5 c* L# m$ItemId = @$_POST['item_id'];
4 ^+ i. b, Q8 Z8 E$ItemUpgrade = @$_POST['item_upgrade'];% Y7 p: j) O6 z* \7 e
$ItemElement = @$_POST['item_element'];
3 c! E1 ^+ \; q$ D$ElementUpgrade = @$_POST['element_upgrade'];1 ? o; g0 Y% a# C9 a h
$ItemPierce = @$_POST['item_pierce'];6 N) ]% f' V! _, _' o$ B2 w
################################; N: n2 B6 T% M! L, q; |8 { k
/ p. h$ @/ D6 S1 r5 z" C7 Y0 |7 F//Check both variables for empty value7 {. S8 ]4 z- s5 ?4 J( ]2 V
& t6 ^0 ^% H, G& L( _, L
if (!empty($_POST['char'])){5 _% Q" G/ c& W- e6 s4 F" v
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ; M! b" v/ |. ]; e9 e }
* |' R) Y% h+ p% k2 N# a7 tm_szName = '{$name}'");( B: A' Q4 _4 I O) d$ B/ {
while ($row = mssql_fetch_object($find)){( s8 D ^7 T4 R
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
7 a) R# L8 w- L. F% R. e5 ?: R$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 4 p4 R5 g0 p. Q7 @0 M
) v/ F; Y H" B/ L. l, ?, s
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], # I# d: m2 C, A' K
( T$ [" ]6 |% @[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 1 C% U$ E2 j% T/ z# w* V. X
' d& w1 U! B4 |0 `: @/ ^N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ) D9 y% P# g% _) c$ a5 F
& X% D$ H6 m. M, V% Y6 R% C7 q
'{$ElementUpgrade}', '{$ItemPierce}');");, y* a: {7 `! g2 Y9 |. L
}- J6 l& {3 \# U
* ` W! r! D* f* \: C& Y$ u c
}
, t5 D8 B, ]- f C5 `5 \1 F9 K1 q2 E/ P& Y
}
! A. V+ _5 j6 [
8 X. o1 e- B/ X, E0 r$InitForm = InitForm();) B( |0 {8 W! ~
$Listener = PostListener();; n3 Y( V8 ?0 v6 R" A
. R H$ @% h- f4 g9 j
?>
9 w6 x- U% o; O2 L0 J7 r6 u% O2 h. q
2 {: V0 `' ^( U3 s
8 H6 o; u; X; j( b! O/ R
: D" Z# d, P; ?/ T. r |
|