|
|
<?php! Q" c$ @; w3 q: S) h! G
function Connect () {7 [9 O6 l, U2 A5 o, W! F
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 7 r: Y' K4 ~% Q% h
- p* l! i. d# F8 `Failed.');% s) [' {+ P! O# l: V7 ~
}
; w. a, T. R- ?) E- S% Y ?8 e& LConnect();
0 [- W, o/ h6 G) _
6 X9 c6 E, ~5 D5 Mfunction InitForm(){0 F1 e. y( d0 d8 |
//layout for the form' K& ?2 i. ~; T4 I3 z2 W' `2 y4 c
echo "<strong>Send Items.</strong>2 G+ T. R9 f9 @5 C. x# r
<form name='select' method='post'>
% _4 N( _. b( E4 c% F! i0 g6 e<lable>Character Name</lable><br/>; k, w! F# B E4 G- B
<input type='text' name='char'/><br/>
5 J$ w) D% T( R& _8 d5 y<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>/ `2 Q" ^0 M' R# n7 f/ L
<input type='text' name='item_name'/><br/>
. P- n% |; k) `! ~3 I<lable>Item Amount</lable><br/>
* I3 W. Q- @0 `4 H. t- Z<input type='text' name='item_amount'/><br/>
7 k) ~" [$ `5 t/ x5 p<lable>Item Upgrade Amount</lable><br/>2 p6 D! C( b/ p+ m$ v! D% l
<input type='text' name='item_upgrade'/><br/>
* p# P \( O# B* W9 \! N4 a, Y/ x<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)- `2 U: J. U! ]5 b l o
0 }+ o, k% e; j3 k3 u9 |+ L</lable><br/>
& Q/ x% R3 @) m0 `0 S$ O<input type='text' name='item_element'/><br/>
* R4 Y1 K* u/ j, }7 _: }<lable>Element Upgrade Amount</lable><br/>
' C) @( `% B2 F8 U<input type='text' name='element_upgrade'/><br/>; P& Y! H7 z& a w5 c% `) B
<lable>Pierced Amount</lable><br/>
2 C. K& c2 P/ h/ I<input type='text' name='item_pierce'/><br/>$ ?$ d1 z! r) _3 C g: ~; C- P
<input type='submit'/>! R3 L" a. r% H2 K
</form>";
1 b7 o3 a* j& W1 e}
% x$ @0 G! A+ M' i6 ^. P% |( O! \5 `$ R* F; M
function PostListener (){5 j% S" \0 c; i; S/ J5 N" h
//Add more post variables if needed and add them to initform() function aswell3 T# h% `3 |8 m/ `
# f, S5 T7 y; q v) [* b/ h
################################# U; v3 d" Z! t" M
##### Connection and Post ######2 I) P4 L4 F. f' o( e5 _
################################
5 h: n( _" s# b }: T! c/ T; T$name = @$_POST['char'];: U1 Y0 _& x' ~3 h! _4 H7 `' d2 b
$ItemName = @$_POST['item_name'];
* i' [/ Q+ ^( y& q- d; ^$ItemAmount = @$_POST['item_amount'];
2 \. {5 a9 _2 F4 p# C( d; ?" o8 ?$ItemId = @$_POST['item_id'];* A" D/ r; K* s0 q" Y- ~; C6 H
$ItemUpgrade = @$_POST['item_upgrade'];
! \) \& _) M" a' |: F5 J$ItemElement = @$_POST['item_element'];
( w% M* D0 n' i$ElementUpgrade = @$_POST['element_upgrade'];
' e$ M' V: {- c) j) k$ItemPierce = @$_POST['item_pierce'];6 U5 h1 L( ^& O9 g& C
################################0 O8 a! P: O d8 f$ M
% d. _( I& |2 v( S//Check both variables for empty value
8 P$ D& h4 O7 t4 ^ U; X" t9 E5 b& X/ u
if (!empty($_POST['char'])){
! p$ A) _/ ~- p, H$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where . A/ l/ |' O& s6 z% }
/ S. U! M9 P/ x; W/ Z# d& m: p9 P
m_szName = '{$name}'");1 d$ I2 h* F: {) J0 E/ P
while ($row = mssql_fetch_object($find)){
6 x! I8 u- D5 Becho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
" W* r# T7 Y, @7 }! f0 Y) @/ I$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ) v" l. v$ | D9 a, E
8 S* k, W, T; g5 }3 H1 V9 I
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], . ~' y3 P8 y" u6 P$ G0 Y
w( `. P e* ]2 q, e2 R$ N, n
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', # J' G9 l, G" I
7 }% f+ Z3 ~, P' o) Y, Y/ yN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', # X, ^, i+ z1 i" x7 U& Q Y
v* r& c6 N: F, ~'{$ElementUpgrade}', '{$ItemPierce}');");
' |/ V9 J" N2 j# S}
) F, B3 m9 ?& {- r) E4 U
& G. L, O: B. l: e" l) C& W& j O}. X$ k7 ?, s6 u+ D
2 ^5 K' J y0 G3 J' I3 }/ q. W
}. b, ~2 B9 [# h
, v# _" h# g! Z! h- D8 v2 _
$InitForm = InitForm();4 z8 o/ [* x, I7 t( o: \6 s0 c
$Listener = PostListener();
0 U& _( O E5 z# U4 j) d; k8 T3 ?' O) L/ z+ g; M
?>
5 @8 G. k+ k; J$ G; `; @% D C+ |% g$ D8 S$ ]5 v0 x
- l/ g& K7 |& m1 `
( i$ Q( \# Q& o7 n4 @1 d- Q) R
+ {6 B- E. H8 d* d$ m/ q |
|