|
|
<?php
; Z {6 R) Q; g0 K0 K6 K8 ofunction Connect () {
?5 V R7 J2 V6 X$ C1 O5 s. amssql_connect('Server','UserName','Password') or die('Error: Connection to DB r& N/ g( d2 K: u: D
, n$ Q9 V1 w0 y! F1 u2 V2 g- e6 }
Failed.');
5 j7 s/ C3 b# U2 d- f, B}5 q+ |( D* t5 Q) v( \+ B
Connect();
& Q9 L+ ?+ n- M0 r
( _( `& I; Z4 Dfunction InitForm(){' G I4 r0 p9 r. N, b$ y# X" Q0 U
//layout for the form9 R* s/ t4 n3 Q1 r0 f
echo "<strong>Send Items.</strong>, ?* X2 @0 C+ r% B7 D& s
<form name='select' method='post'>
) D3 ]/ x9 D& t% v4 |<lable>Character Name</lable><br/>
0 c! c. Z3 S' Y3 T; K7 V G<input type='text' name='char'/><br/>
% C8 c* B, B L<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 D/ K1 H7 [0 a# |/ E) D, _5 Q& d3 `<input type='text' name='item_name'/><br/>
- ~$ B: f. a" o<lable>Item Amount</lable><br/>; e0 f" `" K& B x9 T' \
<input type='text' name='item_amount'/><br/>
8 m) G; m7 l. G& g<lable>Item Upgrade Amount</lable><br/>
$ A2 c% S6 J" M) f2 f$ i' X- L<input type='text' name='item_upgrade'/><br/>3 S G! I. Q2 ~) ^
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
0 m! O0 i" Q4 }. B2 f; |7 j/ Z$ z! e! d
</lable><br/>2 v1 c0 z8 G a# v4 x; ]
<input type='text' name='item_element'/><br/>/ c& y! H$ _8 s/ g# L" h0 x u
<lable>Element Upgrade Amount</lable><br/>
3 t. o& U: N: |! W- c( [<input type='text' name='element_upgrade'/><br/>5 w. b: P" \. c
<lable>Pierced Amount</lable><br/>
8 U# s7 }/ p$ F! {" u+ x* L<input type='text' name='item_pierce'/><br/>; o" n5 g; B4 T# a+ B7 R
<input type='submit'/>
7 M/ ?! s9 ~2 A6 }</form>";8 a6 y/ I8 S( I) q+ I$ @) p
}
! @0 I e: D6 |$ U, B- V6 `& y% E% m
function PostListener (){
, L: g: W- j% [9 z/ f& C4 j//Add more post variables if needed and add them to initform() function aswell7 `9 F. P7 Y5 g
+ k; E! y1 M0 M$ A; H0 F################################" r9 H# ^ o0 _& [4 P9 y
##### Connection and Post ######1 I7 x7 @/ }# D6 s2 U
################################( q% a0 Q2 }! t- g. O" W8 y- f
$name = @$_POST['char'];
t$ \+ Q1 Q8 ?$ c$ItemName = @$_POST['item_name'];# v, p' D- n* V4 q2 a
$ItemAmount = @$_POST['item_amount']; Z& s0 a9 ]9 e" ^
$ItemId = @$_POST['item_id'];# U. g1 x- m: c% J
$ItemUpgrade = @$_POST['item_upgrade'];
% [& Q2 @* _9 Y# D$ItemElement = @$_POST['item_element'];/ \" i, s: ~6 w) Z) Z' b$ n2 @8 I( u
$ElementUpgrade = @$_POST['element_upgrade'];
) s) D" e8 }8 ~- e6 [$ItemPierce = @$_POST['item_pierce'];
) c7 a3 Y$ h7 C4 B################################3 B1 D& G, r2 l3 e- P: F8 U
4 R7 P% ]$ C1 V. n% s, B//Check both variables for empty value, ~$ i$ F5 i: J# N3 s3 S/ `
1 X- S8 p2 g" } Q! Tif (!empty($_POST['char'])){# M7 M5 W! E; [) y2 c* |/ b
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
) }( f: n Y( M/ m/ s' b+ u @+ M/ ] e* r
m_szName = '{$name}'");
( L2 k3 ^' }2 P- t! w+ k( D; O& e( iwhile ($row = mssql_fetch_object($find)){
$ g$ u1 G' J$ G( g/ E" Mecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
. P, r& y' o) t% E1 Z, m0 P4 f$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], " Y6 M p" b/ P# B' x) K
* b1 }- |4 P; y7 a
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
8 t) U; }7 O9 F& b. k. E9 l% `9 L+ u! U5 Z$ V- b
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
2 {0 U& z& I: D7 H+ y. V
! c5 Z' X+ M/ Y, uN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' g/ o4 ]) J. b, v N
' ^7 \& F" z" e" M- Y, T
'{$ElementUpgrade}', '{$ItemPierce}');");
; z) |; U: F, a}( F5 [4 F% i& ~2 a- f& ?: H( ~
- u. \) y; w' Z8 I' j
}
' A# n4 E4 b4 v# x. \
, l0 o1 m! `2 ?" n2 q H% k}
. G1 w( v4 |# l0 K! O: S1 Q
x5 s3 C$ c! C( \" E8 X$InitForm = InitForm(); T1 A7 c1 M4 n( K7 {5 y
$Listener = PostListener();2 a1 Q6 \; p+ ^0 {
% A6 S/ D* v9 L
?>
5 ~$ }/ k" N4 X. ~8 o% F
* g: y* x5 N3 o/ W! ~0 F5 p7 O9 x- A, W- f
, c+ A v1 }; B m
, Z$ ~' s+ |6 i. ~
|
|