|
|
<?php" f7 ^+ z! g0 U$ K6 Q4 Q
function Connect () {2 @. x+ s+ Z/ d% C
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
, s$ c$ F; Y, b6 i1 R3 |# N
) j9 P! {/ ^6 g1 }Failed.');
- F7 a$ }8 }1 H7 s1 }# \}
9 t7 @9 V- }, O, X4 C7 K/ iConnect();
) t2 {& c1 \1 z+ `7 k! l# s9 k
. n1 }) T! K# G$ R' C8 X# Rfunction InitForm(){# V+ _2 n* y- c4 r% _! c. [, h
//layout for the form
, o# q+ C) y3 Zecho "<strong>Send Items.</strong>
" H; H# J4 x! B, x& |8 B6 |<form name='select' method='post'>! N: x/ G3 j2 W4 V+ x
<lable>Character Name</lable><br/>
) P5 h* Q4 t8 w$ D<input type='text' name='char'/><br/>
) K5 O- X* X! a( R, x<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>2 G$ k' u* A$ S5 j6 _& R0 E! _8 p
<input type='text' name='item_name'/><br/>! M* Z6 s0 E# [# K! b6 N
<lable>Item Amount</lable><br/>1 N7 Q- m: O( T+ c- M
<input type='text' name='item_amount'/><br/>
4 w4 p0 o- [8 s9 E# Y<lable>Item Upgrade Amount</lable><br/>
! v2 ?3 P7 i. S( C8 j& \0 Z: r<input type='text' name='item_upgrade'/><br/>
# l/ S4 A! }5 n! g2 h% A: |<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)& i- M1 k/ I, _ [' E
0 T% w6 _3 T. J* H0 E. S
</lable><br/>
, J9 j% Z7 j3 h8 E<input type='text' name='item_element'/><br/>1 h' [! H) a5 o5 F4 z
<lable>Element Upgrade Amount</lable><br/>9 R S7 L" ^" F' q8 b5 E
<input type='text' name='element_upgrade'/><br/>- e8 X: }+ K" [
<lable>Pierced Amount</lable><br/>
$ m" W# T- m& r/ M<input type='text' name='item_pierce'/><br/>
7 O8 X' E( ]) o4 U y# \) h) U* q<input type='submit'/>
7 N" O/ C8 m, a3 y</form>";
% k) S& l8 e( i+ ~+ o}! J2 w* Y) e B! \9 @, ~) S
( b! {, f: R! g$ y% c5 g8 h& j
function PostListener (){1 r- g/ |$ P# h3 G* y
//Add more post variables if needed and add them to initform() function aswell
# o& t# [& F1 w7 [, w
4 {2 d* }/ M; \! q7 U1 W' X################################
4 `4 I1 K# b+ ~##### Connection and Post ######/ W! M6 d: ~- q% s+ j
################################" i7 c& q( K3 f; ~) P6 g$ V4 f9 p
$name = @$_POST['char'];
5 `% h1 s6 }' j; |. T$ItemName = @$_POST['item_name'];
9 _$ i' Q3 E4 Z' I( g$ItemAmount = @$_POST['item_amount'];
, B0 @( d( B( U* J! _$ItemId = @$_POST['item_id'];+ E' a& V% Y1 @$ i+ J3 [. f: ^) Q3 F
$ItemUpgrade = @$_POST['item_upgrade'];1 ?9 [5 t* v7 L7 d$ u, v" U* V0 f
$ItemElement = @$_POST['item_element'];* D: D% K9 A! o& f
$ElementUpgrade = @$_POST['element_upgrade'];& D N. \3 B8 e% B, g
$ItemPierce = @$_POST['item_pierce'];! J8 @0 P! { v5 n" I& y! h
################################/ h5 ^$ q2 _& ]
: C' r( }4 a/ w* ?" J% l) e//Check both variables for empty value+ \2 t: _' n* J
) k3 `* b P/ X2 k9 u
if (!empty($_POST['char'])){
f$ A& v. w% B$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 3 [, Z; i. N. I5 ~$ Z
, n g2 n" \8 d* V0 _( x
m_szName = '{$name}'");
* f$ g0 ]7 b3 l" @4 j, W! J. iwhile ($row = mssql_fetch_object($find)){+ w& m* r7 z$ X: |; b5 e
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
7 @* N' U& N% g# o' b. v: ^* }6 C; Z$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 7 B' l" K) t! C, g
* m- A* R' }% c' R4 C. V* W/ g
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], / \! x& a7 e9 V. j9 {
, l/ j7 g+ Y! Z: E- s* Y[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', $ S7 M1 I; L: h2 N m2 N9 N
) I, L. s4 q8 x! ^* e7 D6 K0 Q4 A }
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
& b$ [& W6 ^6 f7 d1 s7 ]# [! ]# P- G2 Y& c
'{$ElementUpgrade}', '{$ItemPierce}');");
, j: S3 z; v# Z' c/ l5 M: ^}5 h* E r9 g1 t P2 m( A
" V8 i7 Y$ @, I t}8 D4 _& p0 x* H* Z& D0 D# i- n
% G9 M; t5 K; S0 d7 r0 l}
0 i" h' S3 x/ ?- \2 r. ]+ ]
% y6 z- h3 Y; T. Z7 U8 z$InitForm = InitForm();, }# J& g8 p8 H9 u: X' _
$Listener = PostListener();9 v! c, D3 I% w/ l. L# w
# `5 s% J$ U" C
?>0 y; [$ s" y# `. Z# k- x
2 H: r. }: B4 C% P5 n, _7 X: j# B$ W2 R1 G, G, ~
6 U/ S3 T' U9 [ z- e5 s9 |
6 ~- G" j+ Z9 T- W |
|