|
|
<?php! R6 \- w- V+ ]3 F
function Connect () {% \2 z& S1 `) ^* F4 K; U i0 _( R
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
, [! b+ Z) I3 B' ^& n5 d
2 [, w; L/ w3 Q- V; p$ tFailed.');, ^: F8 I- M$ y( F* P- }
}3 P. {. h$ l7 ^* e# s
Connect();1 K$ v% l* X+ v1 v
& ~; M; m- A# {$ E' w& s5 z4 c4 t2 |
function InitForm(){
) T+ n' Z5 \5 a" i6 _" o//layout for the form
8 m% P4 v$ [, _, o6 B+ _8 X8 pecho "<strong>Send Items.</strong>
$ Q$ c! G2 B* ]1 d4 f<form name='select' method='post'>8 T3 _7 g9 I, [( @8 H; A e5 {4 x
<lable>Character Name</lable><br/>
6 W# O; i- G" Y6 }<input type='text' name='char'/><br/>
% j9 C8 d, b2 B0 X<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
" R. z K0 Y* ]! Q: p<input type='text' name='item_name'/><br/>: t+ v O; h9 `$ ]- _, x! s. `
<lable>Item Amount</lable><br/>$ ~7 w% _; W+ `
<input type='text' name='item_amount'/><br/>
4 B: R4 x1 Z- g9 A! ?) T<lable>Item Upgrade Amount</lable><br/>
2 p5 A( C# j. b" A/ K8 o- D<input type='text' name='item_upgrade'/><br/>1 }& E( }0 I% C' @4 v2 n+ k
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
( M1 V' k% H0 _) q0 M6 `& O, s6 p2 ?1 l' O5 m3 V# {" X9 U% k
</lable><br/>
" f: {! C J) F: A7 C* u<input type='text' name='item_element'/><br/>) @: w* d* b- p+ ~, ~# ^
<lable>Element Upgrade Amount</lable><br/>
/ Z% t. ?$ S& @4 j<input type='text' name='element_upgrade'/><br/>
3 d. h3 n4 C& t, F9 A, ?) R8 p<lable>Pierced Amount</lable><br/>
+ F' B9 k( o. F4 y4 N<input type='text' name='item_pierce'/><br/>
9 b5 ]5 c; ?& Q) D<input type='submit'/>
9 j6 a, s0 w( U3 T, C& M</form>";. V- ]; ^; G7 ^2 W% u# I7 w
}
; X/ O8 ^% K0 t* ~7 f4 f- M7 Z8 t8 B: k$ F9 N
function PostListener (){) ^8 ^# i& n+ Q! @. `0 c8 B
//Add more post variables if needed and add them to initform() function aswell$ U2 ?9 ~! ~+ C! d
7 k" y& u% R6 _# e! s" \& Y- b9 P. b
################################% Q+ w5 T* g% M' u0 ]. m
##### Connection and Post ######
# P% a. _2 A4 u! L% i% P! Q/ a################################
$ C& J5 i1 ?1 r" e, m$name = @$_POST['char'];7 a5 c1 r; I1 D/ C. i% d. J' A+ `
$ItemName = @$_POST['item_name'];5 F6 }. `+ H% R& x5 J/ T' O; H
$ItemAmount = @$_POST['item_amount'];! I. O# b1 b2 f# {7 M
$ItemId = @$_POST['item_id'];0 E1 m' a. n! x [" m2 k) L
$ItemUpgrade = @$_POST['item_upgrade'];2 c5 c/ `. I- `; ]# v
$ItemElement = @$_POST['item_element'];$ Z7 y1 v3 P: W/ R4 i# t0 x
$ElementUpgrade = @$_POST['element_upgrade'];2 J& k( L* a* v3 w
$ItemPierce = @$_POST['item_pierce'];% [# {0 H3 i& O5 E6 E+ z& M! ^
################################
6 O( `( W! T( F* h
1 U" A+ B! z# B//Check both variables for empty value
* _1 b; l* J/ u) Y, h+ t+ x5 i! O D) ^ S5 Z9 A
if (!empty($_POST['char'])){4 R, M; M& h. D8 H' B+ T
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
/ [6 L' D- w% M
, U; i, G5 ]0 j/ am_szName = '{$name}'");3 ~* c2 K' H! @, h
while ($row = mssql_fetch_object($find)){
) R; k) z9 ?8 T6 |! W- Gecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";5 l4 ]3 w+ Y X# m* S
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
) C) x7 I9 n6 I4 ?- K5 Q, n6 B, I! ]8 [6 y, I- I- T, o
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ' p3 a% i v8 V2 z7 k4 W) m
5 e/ }+ C& p3 c- K[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ' J5 C/ b$ q6 K+ E( S
7 ~- y( I* f' Z Z% zN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 y. V. ]7 q' }3 j: P: U, ]) w; `
- g5 c2 t; D- f! |5 R* t
'{$ElementUpgrade}', '{$ItemPierce}');");
. d& W' R9 d' v5 l8 F; p$ m0 h}
: |: X( s9 B* d2 b# f
# n9 L4 V/ u2 |, h1 \}
+ [% x# U9 l9 f1 X; `5 P3 N" c/ Z% B k2 c9 O' r" x* [
}
, g/ ^+ T* ]1 m: T1 o* W! A1 H$ ?6 K; X+ E1 [
$InitForm = InitForm();' h( C5 D8 b5 B
$Listener = PostListener();
. I6 J- c u5 t/ ]# k0 }' W
) O$ M o: B6 J?># b7 K, F2 |+ j \0 Z
3 o' D( }7 X" E# A9 A
/ o* w4 H/ Q( W3 ]+ I# m2 a% S2 W4 X+ Q5 H( C/ ~: K/ L
9 J% N/ Q% C# p0 `8 K" U
|
|