飞飞世界论坛

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

物品发送脚本

[复制链接]

197

主题

203

帖子

1086

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1086
QQ
跳转到指定楼层
楼主
发表于 2016-1-10 03:43:06 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
<?php2 _, v6 n! o/ s0 K+ n$ c9 O
function Connect () {
* ?& x* [. ]' }2 j" pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# g8 x$ l2 z/ P) }" M. g% }- ]0 W/ W, K8 I# `8 {
Failed.');
" F; _% S0 T. v, {$ U}9 S  r- p. T8 I6 J7 l0 |
Connect();
8 s% ^- J# a, h! j1 n5 i( m: o
; X- q" X1 e" w0 N  k" W2 L" dfunction InitForm(){
- [8 m8 U9 @, Q2 r# M4 _/ ~//layout for the form
# w; C6 R% I7 f5 decho "<strong>Send Items.</strong>" _# C9 ~( V. Q- B1 ?
<form name='select' method='post'>
* j: x+ l, s* r1 H2 o1 Y<lable>Character Name</lable><br/>
9 W. E) g9 ?6 u<input type='text' name='char'/><br/># {+ g; z* j1 z1 m4 k; G. I
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
( L3 l. A* ~$ h  {<input type='text' name='item_name'/><br/>
3 P; e7 e) j9 V& D! D# r<lable>Item Amount</lable><br/>1 b" J# u- k, d' x+ c: F0 k) i; h. x+ F
<input type='text' name='item_amount'/><br/>, C5 N$ S8 A; Z2 W* b
<lable>Item Upgrade Amount</lable><br/># `4 r! d" L3 X4 B
<input type='text' name='item_upgrade'/><br/>( J/ D5 C- Z; B) j
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
* @: N& a7 H* h1 K5 H7 y
3 V$ k1 p3 S1 Q. }) W, m</lable><br/>- r2 ~8 k4 I5 L5 S7 i4 H5 R
<input type='text' name='item_element'/><br/>6 q" G; P/ X! p7 ^) ?/ o
<lable>Element Upgrade Amount</lable><br/>! `7 y2 V) K. `: O$ k
<input type='text' name='element_upgrade'/><br/>0 s( w1 \9 H1 c0 k
<lable>Pierced Amount</lable><br/>! |; L/ R! J/ J% i" _( w! S$ s
<input type='text' name='item_pierce'/><br/>
* ^5 M* b+ u; G! t: h3 k% ]2 j; N<input type='submit'/>
" q) m) ?* j2 e; X! O</form>";
% I; ~7 o. D) t' F}  Q. e4 K5 n/ ?1 D# d
6 N2 v- F0 x( D& A) x1 F+ I2 Q
function PostListener (){
% V' m# O1 C$ p. {- v) W//Add more post variables if needed and add them to initform() function aswell
3 N1 r  o$ Y, R) g# I" ^# f$ M& Q- z. {7 ~, h
################################
$ r0 c, E9 v) w4 k1 X& \##### Connection and Post ######( G, _1 l/ ?8 Z: u3 T$ o, v
################################
: g3 ~) B1 ^& W: r$ E7 X7 ?$name = @$_POST['char'];/ p  g8 R5 [1 Y4 U$ f
$ItemName = @$_POST['item_name'];1 {6 l9 q5 v, K, \) Z/ u* o
$ItemAmount = @$_POST['item_amount'];
9 K% C( `5 T! z# x$ItemId = @$_POST['item_id'];
) S$ O5 n! e0 U$ItemUpgrade = @$_POST['item_upgrade'];0 y; |( L  X& V7 B- F7 M7 V
$ItemElement = @$_POST['item_element'];% v* Y2 _- o2 _  M' [
$ElementUpgrade = @$_POST['element_upgrade'];. V9 h5 [/ l' }+ m
$ItemPierce = @$_POST['item_pierce'];' P8 d0 O+ A* i* k
################################
7 M4 [- t& S/ ~$ X( a$ k
. N( i% n( [1 {! g* F4 I: d//Check both variables for empty value/ D: ]# p4 v+ `$ j
* g7 a; `3 V# d) G
if (!empty($_POST['char'])){% W2 |1 y* f: f$ M4 ]8 Y: i* Z
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 7 g$ Y* n) B9 [- ~
/ M/ h' @$ x5 U: Z  h
m_szName = '{$name}'");9 h0 ]3 {, N  ]6 {8 {8 j
while ($row = mssql_fetch_object($find)){
& m+ I& a- x0 p- ~: U  Vecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";" E" e, D9 u& z7 T8 ^! J
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], $ r" J- r* y- w* b  Q) u

2 f, y& a! }! d) I0 w* ]4 S[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], $ g# x6 }6 N# [* M- e

$ M6 s4 a9 v, ?+ W4 k[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 3 s+ r) |) ?# s/ b4 Y
" o4 o4 P# j! A( X2 N  w. \* l
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
/ t# L; Y- h- z) \$ m5 E  [) \9 t: L0 F9 b  e
'{$ElementUpgrade}', '{$ItemPierce}');");% ]2 k% \4 Y. e/ f& u
}
& }4 n- [% g, }0 Z2 p0 F0 |+ O* h: n* w3 l* w6 @, B
}2 \6 K* e- b" `" R, p

( B- Y9 M* l' G3 ~}
% Z! d  P+ C( F/ Q# \% b- v7 Q
# c7 j3 A, c2 S1 d/ d$InitForm = InitForm();9 p2 P  O7 j1 Q9 ^0 ?# E* X
$Listener = PostListener();6 `( b/ D& |( F8 L/ `" i

5 ~0 J( q9 `( a" ^. S?>6 ]7 w# j$ y: `. z, t
1 o/ [! d3 C# Y4 k( K7 ?, E
2 I( A4 V& P' v; m6 v% b! Q

+ J, v2 `6 b4 s' N. e
( h& Y0 R% l2 n$ n: t$ o2 C/ B: L
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2026-1-12 21:34 , Processed in 0.080144 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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