飞飞世界论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 14635|回复: 0
打印 上一主题 下一主题

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
<?php
( O& \- a6 R. }0 V9 zfunction Connect () {
& e( ~" V5 @8 v4 M- C4 e+ C* Jmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
7 O$ Q5 k+ s. F7 w/ {/ `
1 H& G& Q! s1 z  Y1 n3 G1 x! U; AFailed.');
$ w2 e  n: Q& W2 T: g9 A/ d; O}- s' z, a7 E: S9 x. N
Connect();
5 b7 {; K7 F3 ^$ M3 ~' x5 ^/ Z3 M. K! _8 ^6 r
function InitForm(){
; T6 q3 }1 O( d2 W4 D//layout for the form4 u; k1 g( H! O
echo "<strong>Send Items.</strong>$ N9 l: G6 B) p/ w
<form name='select' method='post'>) A" a9 M: L- L! @% I0 \
<lable>Character Name</lable><br/>
$ g. u8 ^; c: J/ s, U9 j<input type='text' name='char'/><br/>3 h- c+ i) Z2 r, b. \
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>6 n" F/ }3 ~. K: P& g1 ]( y
<input type='text' name='item_name'/><br/>
9 Y. P! e- y7 w) q; d+ W% J<lable>Item Amount</lable><br/>) O$ N6 R7 R1 M& w: k- y9 ^0 e
<input type='text' name='item_amount'/><br/>+ ?1 e5 `: F+ q2 K9 W" {- l
<lable>Item Upgrade Amount</lable><br/>( u. d" C3 |) l1 d8 F
<input type='text' name='item_upgrade'/><br/>
3 g: ?6 B" S1 F2 U8 g' }5 O/ b<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
7 `/ j( K2 h$ f
6 u1 L( ?3 R/ @$ q7 K( n: I</lable><br/>! ]( A* M7 M, ]# v, ]+ P1 o
<input type='text' name='item_element'/><br/>; |6 V" B& i' a7 w: Z1 s1 d
<lable>Element Upgrade Amount</lable><br/># G1 O) ^: Z! b0 e! Z/ M
<input type='text' name='element_upgrade'/><br/>
6 c+ O9 B  Y( E) _<lable>Pierced Amount</lable><br/>
: H9 {; k1 o& [) f<input type='text' name='item_pierce'/><br/>
; j$ M- w* r, Q5 j3 ^<input type='submit'/>& A1 F7 H- E; r$ ~9 |
</form>";
& q* T4 k0 w3 ~8 B% {}
7 S: K: j1 j" o1 M7 `7 F
- c( X& P( W: a0 G+ qfunction PostListener (){2 }5 z) F/ n0 |/ U% J
//Add more post variables if needed and add them to initform() function aswell% Z! x9 ]% A+ w# J% n

, @% ?! d, d" X" l, ~; }################################
6 H4 f6 l' P) V% j##### Connection and Post ######
! o0 \, M; h5 \2 L9 u& @9 }1 L################################# ], J* Z/ R- V' ?0 h& M7 \. p
$name = @$_POST['char'];
0 Q# n' x) ~( m; y$ItemName = @$_POST['item_name'];% q! h7 S0 o4 o; b& m- ]
$ItemAmount = @$_POST['item_amount'];7 t! M" P% r3 n4 Y! f
$ItemId = @$_POST['item_id'];9 W. F' R6 Q, N  n+ v9 c
$ItemUpgrade = @$_POST['item_upgrade'];' W( Y* _- @: K8 {' I+ D) u- n
$ItemElement = @$_POST['item_element'];
& B% @" U% w( Q( V$ElementUpgrade = @$_POST['element_upgrade'];
. u* ~; n# W" f$ItemPierce = @$_POST['item_pierce'];3 @% G2 Y* D/ C) ?
################################' e5 m2 ~$ H# s$ r' ]& a+ C; [

" V8 W3 u& t' Q- A//Check both variables for empty value9 o. E+ ]1 ?# A
; h2 x( l8 u7 [1 r
if (!empty($_POST['char'])){
. @* U4 o# ^" }6 F# d& a2 [4 s$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
! v2 N" _  f1 c4 ~
6 I& E4 _3 C4 Km_szName = '{$name}'");
/ `/ [" F3 p' g0 T  B* r% Fwhile ($row = mssql_fetch_object($find)){, T. P0 y0 O- P. Z& ~
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";! [5 g9 `& m4 E* v! _# D9 H. I6 }
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
2 ]' ?5 o" \9 \% k' Y5 D. p# f% [) Y2 _3 h6 f
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], : d2 W; ?! |& U/ H) w

) g: s7 J( E: _6 t# s  p[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 t- B& o& \/ U$ R* d& C, H' F# t& \
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', & C6 ^5 [1 u/ y* y' z
4 i7 r5 P3 I! m1 k/ |
'{$ElementUpgrade}', '{$ItemPierce}');");
: E( m; j' h8 s! C}/ f' [. b" V* z  F$ S1 N+ Z: K

" [- x+ e1 _: G: ?" m}) r/ W: {+ M0 D+ F0 n( T/ N

. [* l' `' I1 d9 `}
. J" K; u$ a3 \6 z0 x' n: c9 O, t6 G
$InitForm = InitForm();/ n/ Z( S. x9 d/ A
$Listener = PostListener();0 \8 \2 [" R* B$ ?* X8 D% U
, R) A$ `3 w3 E
?>, d3 |  `* \  M' c9 @. Y; N

/ `4 e# `  @* ]; g) {1 ]
$ q) n0 O9 s3 p6 ?; e* Y+ N
/ U' y; Q5 s4 |" J  U1 e
: J8 Q# `' n6 d
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|飞飞世界技术论坛  

GMT+8, 2026-1-13 14:15 , Processed in 0.063370 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表