|
|
<?php
2 B4 g- g8 \0 \5 f# |. W: yfunction Connect () {" m9 ]6 R5 f+ q
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
) U; J& |: C( ]! m" a2 I1 @" a) N0 S6 J' W
Failed.');& c( E0 k3 V$ ~# O+ E
}
6 x. k4 R2 j: Q: Q! t' UConnect();# X/ g! ~, K+ a$ {. |3 M
E) [- f3 ~/ Q7 \: h
function InitForm(){; I& Z+ Q5 W) ~
//layout for the form: L* d( P. |5 a! o! R% P3 T! }
echo "<strong>Send Items.</strong>
/ i- s$ h5 S1 D) Z: s. B! `<form name='select' method='post'>
, K4 W! i+ u0 C8 j/ j<lable>Character Name</lable><br/> o" T- e: V0 ` ^) K
<input type='text' name='char'/><br/>
) n$ c) I: h0 t! G6 b<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 S4 s* `+ I* E<input type='text' name='item_name'/><br/>
2 O, H: y7 V$ {! w5 {<lable>Item Amount</lable><br/>
: ?% J: t; y, k<input type='text' name='item_amount'/><br/>
2 d8 m& v5 `# U0 w# `( }<lable>Item Upgrade Amount</lable><br/>2 f H; W( A- {: }& r: l% f
<input type='text' name='item_upgrade'/><br/>5 s9 R; e. o- P6 u9 s( T5 H
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)0 }" w8 R% b1 b' g5 J( J5 `7 {
2 `5 y) m; g- n6 e! R7 k) b</lable><br/>
- Z' I; w6 l; j! A" _<input type='text' name='item_element'/><br/>( z' n; G# ^% V6 V
<lable>Element Upgrade Amount</lable><br/>
% n5 L: r5 z8 m; F<input type='text' name='element_upgrade'/><br/>
$ Y6 J8 k7 |) r$ z4 U5 A<lable>Pierced Amount</lable><br/>
( N+ o6 g/ v. U# i* C$ I$ t' F<input type='text' name='item_pierce'/><br/>
u0 \; L% i% [7 @<input type='submit'/>3 d- }% D# O4 o4 D
</form>";
/ L6 A& l1 [( j! h}
/ J( }7 x( f7 i3 z8 n2 s/ a' j- K6 U7 D, ~6 P( }; s
function PostListener (){
& E/ Q! s, P# r7 o//Add more post variables if needed and add them to initform() function aswell7 M& G8 E# L0 u! Z* ~/ b( s6 i
$ Y$ p& v) @0 z6 b N( ?& }2 x
################################
4 I% `' J! X- y6 o##### Connection and Post ######
( @1 @; ]* m8 i6 \# }# K################################
4 B/ D, X4 Q! }+ B4 ?5 c$name = @$_POST['char'];
* Z$ ^- r3 w- h% d. c9 g$ItemName = @$_POST['item_name'];
+ n% s8 X. r% U" ]2 f$ItemAmount = @$_POST['item_amount'];7 i8 F; }: j2 k8 H+ n' t5 N; H
$ItemId = @$_POST['item_id'];& z) ^: D# n& V! T" S+ c" d
$ItemUpgrade = @$_POST['item_upgrade'];
0 W7 d! z0 ^# C0 {+ [8 @$ItemElement = @$_POST['item_element'];
% L9 ~8 i; b+ y$ElementUpgrade = @$_POST['element_upgrade'];2 p2 j1 A" g+ v
$ItemPierce = @$_POST['item_pierce'];( g3 @* B, ~2 x
################################3 V( }+ {9 R1 }8 z; `+ F/ m: I
m1 c- w7 n& y- d
//Check both variables for empty value+ h, e3 t3 r/ y6 h) D& D
9 E1 V* e7 D& N3 h3 H& v
if (!empty($_POST['char'])){/ D& b+ c" P' }4 u0 ]$ ?3 p
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 3 C4 z# @1 X b. [1 u
2 k5 R" p# `5 j" z
m_szName = '{$name}'");- [! d: f. \; B2 Z% N* n" N, F/ A
while ($row = mssql_fetch_object($find)){
& }! z) T9 g# w7 j8 U3 J7 @" ?echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
4 Q. h- L- U- C3 T9 T( X$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], & H* n3 [8 M& U6 j' w! l) `, a' _
7 B; p, v9 h8 J1 x[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], , O' A( y/ E' f
& {; [5 Q, y. ]4 U& ][m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', " S( C8 M0 Y4 C
, P3 V& [& a& t1 s9 q) t' ~N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 ]. y8 N) Q( O8 n
, q; u6 Y8 {2 O* a, ^' B. `" J'{$ElementUpgrade}', '{$ItemPierce}');");2 R( z2 h; ~3 C" g
}: J; H- r; E+ ~ @& Z, t- ]
/ ^" f% v; b9 j+ t R
}
7 j. i$ _' J5 x9 ^
; ?# o5 ^4 u% N1 K( S}
# Q$ J, d7 Q; I+ _
( ^/ Y% n t7 `: d$InitForm = InitForm();! y0 N* R' \) g/ e2 ~: m9 Z. m
$Listener = PostListener();
. ~( n# k! J2 E1 X; X3 p1 ~0 ?# t! v; c
?># O3 r, t' N: ]
5 W8 s- r& n# B
# v$ [) i" d* @5 p" z! M* O& u/ ~( B, V' ?* [& v( R: y5 L5 o4 d
$ @3 f1 R6 f# @" v( j |
|