|
<?php" E# n4 I3 E3 A2 U
function Connect () {
" @1 z, S6 }. W0 Y3 hmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
! M' j. y* ]9 w% k3 Q0 k) h
3 L: N. g# g: t: E, h1 K1 oFailed.'); {" C) K( s0 Q& h% T
}
: G& ?1 w3 R Y/ V! Q4 fConnect();% q7 b: I6 R) ~# g
0 C X! Y; [6 T. ^. yfunction InitForm(){
* M" k9 B, u! C7 U% o/ F//layout for the form
" ?) x6 l& f* a) B/ Q9 yecho "<strong>Send Items.</strong>
Z% y" A/ q1 }<form name='select' method='post'>: l! s |4 {$ e/ ~2 }2 X
<lable>Character Name</lable><br/>) @* O+ f3 a0 r7 [* C; N& y2 [
<input type='text' name='char'/><br/>* v2 g% Y% s6 c- V
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
2 k, U! l0 e2 C' A<input type='text' name='item_name'/><br/>" \5 g9 p; I+ m" D! u% S" ~
<lable>Item Amount</lable><br/>
* z" t& P# \$ }3 H<input type='text' name='item_amount'/><br/>/ S1 G8 `. z; X& ?4 H
<lable>Item Upgrade Amount</lable><br/>
# y* L l6 i% g, [<input type='text' name='item_upgrade'/><br/>0 B% p, O9 y. @% N; Y) d
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.): r3 M$ t. `$ |3 _
1 h2 T/ g. S& e- ]' `% G% G
</lable><br/>; K, Z Q3 c) P' U/ C$ \ c' t! f
<input type='text' name='item_element'/><br/>
. \" q& ~4 z- U8 x, \& g2 q<lable>Element Upgrade Amount</lable><br/>2 i2 e$ {' z. d+ v: W' U, ?4 c
<input type='text' name='element_upgrade'/><br/>
1 `0 z g7 u% t+ U<lable>Pierced Amount</lable><br/>
3 ]4 n$ E& ~2 X1 J/ x) s<input type='text' name='item_pierce'/><br/>& Z2 c. n3 G, q0 u" T+ @7 j$ a* Y3 O& g
<input type='submit'/> Q# [9 M3 s* o
</form>";
$ Q$ W" N: ~* C; p/ D}
% M' g- `! h# d+ q) s5 b& ]* o, i8 K' C# n: `7 l6 l
function PostListener (){% h! p2 A+ d8 @# N% k" c
//Add more post variables if needed and add them to initform() function aswell
9 m D) D6 j. ?. F9 W, r2 V- U' o D" ^
################################
, p5 E( i% Y+ ]##### Connection and Post ######% _# i' q3 ^# s- z
################################3 C" O! G: U8 C/ d, z/ {9 O
$name = @$_POST['char'];# c1 H3 K% D0 Y' y' W1 \9 u( @; h
$ItemName = @$_POST['item_name'];
( H0 b% Y. H9 L) W4 u8 f$ItemAmount = @$_POST['item_amount'];
- ?% [: i# B, Z D& x$ItemId = @$_POST['item_id'];0 S* X8 q+ d. N9 B# z
$ItemUpgrade = @$_POST['item_upgrade'];
& k4 D. {4 ]1 x; S" |( e& d. ?$ItemElement = @$_POST['item_element'];
, s3 t; _: \9 f4 N! v$ElementUpgrade = @$_POST['element_upgrade'];& a% ~- I) ~. R: G* e
$ItemPierce = @$_POST['item_pierce'];( y" G( _& h$ P$ C5 J7 @
################################0 s8 \+ P U! h
) V9 K" l- {: [4 C( D- J# ~) H//Check both variables for empty value
, V6 B1 E3 T* H1 e
$ F3 i7 A, p: O; T; V# {2 q1 `if (!empty($_POST['char'])){
! k B1 W$ e+ t& [$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where * u* I* w E: h9 E
: }, N9 m4 g4 c8 j& P
m_szName = '{$name}'");1 t6 h' I! T. {
while ($row = mssql_fetch_object($find)){1 D4 N+ {( i3 I# F3 S5 @
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
# c. D+ u) j4 ^/ g/ w$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; s. o f; A; r% u2 h8 S _5 V5 e
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
- [3 j7 u! r/ |( y5 E6 O* y$ V" V
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ' f, }8 {* U1 E0 l+ ^4 Z
8 ~( J/ f+ n* r& _. w4 f3 \
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', $ k: I- e- y: O
+ l6 P. {0 K7 X+ b
'{$ElementUpgrade}', '{$ItemPierce}');");& G0 `3 K/ x4 h/ P/ E9 g
}0 |. L$ j+ \7 U9 p; l0 A P
; u7 F- _" Q/ g! M# v
}
% F- G: p3 e I4 r$ k
! L9 ?& \; _( R3 d- A8 R! d}3 s- U. A7 Q' N# m- d
) t/ b2 [& d6 n$ v5 b- q
$InitForm = InitForm();
7 E% _* |- \6 b' D& t, u" N G$ F1 s$Listener = PostListener();
! V; s8 G+ |* @% V$ B7 w9 o
7 V# [, r" I& X% ]?>
- { n& q5 {, E; Q/ q
& K, x2 O. O2 }" ?( p6 Q* D( M; V0 T* K e; a4 o/ S
9 v: O- x: `& Z
# W- a& x" T& I) W& J9 p
|
|