|
|
<?php
' a' M' e7 r. jfunction Connect () {
2 L+ @' m' m. _8 pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 2 C1 e6 A% K& w! \9 P; L
: x3 e9 P n/ d2 O
Failed.');$ F0 {# w- E" q2 }# P1 K0 k" i% P
}
6 s. ?+ B4 k, ^4 x# c; IConnect();
6 a& t+ W& c4 O- k2 j
! k/ L- y; m0 l; A4 s2 n pfunction InitForm(){
) j6 G: a3 }& a+ t) ~+ |//layout for the form
3 Z; ^ m0 ~6 C( yecho "<strong>Send Items.</strong>
; k! ~% ]& U$ m% }' |7 k, c<form name='select' method='post'>6 C0 _" i( x7 K1 _! N$ T
<lable>Character Name</lable><br/>9 t: z t0 B# c* p& s, J
<input type='text' name='char'/><br/>2 P- K l. s( V L* F9 o
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
8 ]5 C( x0 Q1 m7 \3 m2 k+ v. D( D<input type='text' name='item_name'/><br/>
5 [) `; W) I& t5 P5 Q j* l<lable>Item Amount</lable><br/>7 v1 C1 S k% f) e: Q3 l2 ]1 J
<input type='text' name='item_amount'/><br/>9 O; r0 q9 R T
<lable>Item Upgrade Amount</lable><br/>
7 _% i7 Z8 ?8 c4 S) p<input type='text' name='item_upgrade'/><br/>4 P0 E* `; s0 `& b" m; u
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
9 `) k6 U3 \8 \$ L% _$ |) ?
/ h/ `' J- t6 Q6 m. y9 t% ~</lable><br/>
# q6 p" R+ \6 ~) W<input type='text' name='item_element'/><br/>
w/ b4 m+ ^- ~! e4 C: q1 x<lable>Element Upgrade Amount</lable><br/>
2 a/ }: g- `# d% ^& \9 L7 g6 n<input type='text' name='element_upgrade'/><br/>
2 ]( e& x% R' @& X# L<lable>Pierced Amount</lable><br/>
5 P. c* r2 ^! O<input type='text' name='item_pierce'/><br/>
+ x$ o C. J1 ~) o# i<input type='submit'/>
" ]( W0 A: B' N& w, e</form>";2 i2 v7 s8 W4 K e' J0 T
}9 \$ Z9 T) U" L! y |
5 E5 Q+ B6 D0 A* |, hfunction PostListener (){, |9 R. [7 Q) e& E* X% Z
//Add more post variables if needed and add them to initform() function aswell4 Y" p% z' r7 l) ~' ^: p% D/ p) L `
% p3 d( ^7 C* l# c& j0 P9 e7 |
################################1 K7 g6 m. k5 U4 j: |1 Z
##### Connection and Post ######2 F* Z8 A3 A2 n
################################
3 L7 D3 W0 v5 @9 F" O! k$name = @$_POST['char'];- }* ?6 B" m+ t
$ItemName = @$_POST['item_name'];
: ?4 A, v3 a! [/ X; S$ItemAmount = @$_POST['item_amount'];& g9 ]6 \1 F* E9 r
$ItemId = @$_POST['item_id'];
" d8 t8 }! b& W& t( d! z' X9 r$ItemUpgrade = @$_POST['item_upgrade'];
/ k5 c* `, S' T. H- y' Q$ItemElement = @$_POST['item_element'];1 e: a0 m2 n# s1 {
$ElementUpgrade = @$_POST['element_upgrade'];8 ^- y7 D! z; F: i" U7 I' N& C
$ItemPierce = @$_POST['item_pierce'];1 P) r: Q5 a/ |0 s+ _# e& G6 s
################################6 X& k7 ~, A+ y& Y" ]
/ B: O) G5 z6 r0 o s, T6 b//Check both variables for empty value" R: F8 T, S, N
q. c4 e1 Y$ o9 }1 qif (!empty($_POST['char'])){) X: w3 G. V) [% G9 @+ L
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
t1 p) X( W! d% H$ }' P0 ]# P# W8 H" L
m_szName = '{$name}'");
+ a- B6 t+ N8 S, cwhile ($row = mssql_fetch_object($find)){, U7 N/ S+ J5 }3 w: A2 U) f# z* Z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";# _9 d' D+ X1 ?
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
+ H8 P8 [3 ~/ f+ f) I/ @2 M1 J( s" h& D. R6 v- i' T. c
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 6 {1 t9 r' q+ X* h) ?2 o) D. |
2 j1 j* f/ G1 ~7 U4 h( a: f
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
4 V* ^! }% z9 L$ V' h8 ^
% L: V% f4 ^% h1 W# K" ?N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
3 D$ Q. c, |; U' T) A8 R
5 \' f7 A% d8 {9 e0 U' |'{$ElementUpgrade}', '{$ItemPierce}');");+ c7 R3 T6 H5 i6 s+ e5 q- C
}
: \3 X/ I# O' O9 v0 v, o+ b/ y6 m$ t
}
" c" o: D. w% N: ^' ]$ }$ W) b- Z1 f$ }' V
}
* j @8 o6 x( [" o9 p# C0 Y: s& ?) u& z, h
$InitForm = InitForm();- d, e2 R: t) _$ E8 W" r/ \
$Listener = PostListener();
9 z5 C0 P3 ?0 b* n; K5 Z' a: L, ~; |( c2 v
?>
! [' x9 x7 ^! W( p# M. g
) }* i8 b% M& j8 f9 l- {5 u2 [" W! `5 v" g/ c
2 k; @# y% a, G
/ n; q1 N. \+ H; ?
|
|