📄 list.php
字号:
<?php
//error_reporting(0);
include_once('global.php');
echo '<table style="text-align:center;">';
/* 检查提交方式 */
if (strtoupper($_SERVER['REQUEST_METHOD'])!= "POST") {
EndOfPage('提交的数据错误');
}
/* 获得提交数据 */
$account = $_POST['account'];
$pasword = $_POST['pasword'];
$picmama = $_POST['picma'];
$piccard = $_COOKIE['authnum'];
/* 检查提交的数据是否为空 */
if ( $account == ''
|| $pasword == ''
|| $picmama == '' ) {
EndOfPage('您要使用的帐号或密码含有非法数据<br />请返回后重新填写');
}
/* 检查数据长度 */
if (strlen($account) < 4 || strlen($account) > 12) {
EndOfPage('您要使用的帐号长度不符合规定<br />请返回后重新填写');
}
if (strlen($pasword) < 6 || strlen($account) > 20) {
EndOfPage('您要使用的密码长度不符合规定<br />请返回后重新填写');
}
/* 检查帐号密码数据是否含有非法数据 */
if (!ValidData($account) || !ValidData($pasword)) {
EndOfPage('您要使用的帐号或密码含有非法数据<br />请返回后重新填写');
}
/* 检查提交的验证码 */
if ( $picmama == $piccard )
{
/* 实例化DB类 操作audition库 */
$db = new DB($db_host, $db_user, $db_pwd, $AU_db, $pconnect);
//$itembuy = new DB($db_host, $db_user, $db_pwd, $AUitem_db, $pconnect);
//unset($db_host, $db_user, $db_pwd, $AUlogin_db, $AU_db, $pconnect);
echo '<form name="register" id="register" method="post" action="usershop.php" onSubmit="return checkdata()">';
echo '<table class="register" border="1" cellspacing="0" cellpadding="1">';
$query ="
SELECT UserSN, UserID, Password, UserNick, Level, Exp
FROM userinfo
WHERE UserID = '$account'
";
$check = $db->query($query);
$count = $db->num_rows($check);
$wannabuy = 0;
if ($count != 1) {
ErrorLogin("帐号或密码不合法");
} else {
$result = $db->fetch_array($check);
if ($account != $result['UserID'] || $pasword != $result['Password']) {
ErrorLogin("帐号或密码不合法");
} else {
$usersn = $result['UserSN'];
echo '<input type="hidden" name="usersn" value="'.$usersn.'"></input>';
echo '<input type="hidden" name="account" value="'.$account.'"></input>';
echo '<input type="hidden" name="pasword" value="'.$pasword.'"></input>';
echo '<tr align="center">
<td width="center" colspan="4"><B>人物资料列表</B></td>
</tr>';
echo '<tr align="center">
<td width="15%"><font color="#000000"><B>玩家帐号</B></font></td>
<td width="15%"><B>'.$result['UserID'].'</B></td>
<td width="15%"><font color="#000000"><B>玩家经验</B></font></td>
<td width="15%"><B>'.$result['Exp'].'</B></td>
</tr>';
echo '<tr align="center">
<td width="15%"><font color="#000000"><B>玩家昵称</B></font></td>
<td width="15%"><B>'.$result['UserNick'].'</B></td>
<td width="15%"><font color="#000000"><B>玩家等级</B></font></td>
<td width="15%"><B>'.$result['Level'].'</B></td>
</tr>';
$audition = new DB($db_host, $db_user, $db_pwd, $item_db, $pconnect);
$query ="
SELECT uwc.ItemID, al.ItemName , al.Cash
FROM basket uwc
LEFT JOIN avatarlist al
ON al.ItemID = uwc.ItemID
WHERE uwc.UserSN = '$usersn'
ORDER BY uwc.BasketID
";
$check = $db->query($query);
$count = $db->num_rows($check);
if ($count > 0 ) {
$wannabuy = 1;
echo '<tr align="center"><td colspan="6"><B>预购物品列表</B></td></tr>';
$index = 1;
echo '<tr align="center"><td colspan="1"><B>购物车位置</B></td><td colspan="2"><B>物品名称</B></td><td colspan="1"><B>出售价格</B></td></tr>';
while($result = $db->fetch_array($check)) {
echo '<tr align="center"><td colspan="1"><B>'.$index.'</B></td><td colspan="2"><b>'.$result['ItemName'].'[永久]</b></td><td colspan="1"><B>'.$result['Cash'].'</B></td></tr>';
$itemidxs = $result['ItemIdx'];
$result = $db->query($query);
$index += 1;
}
}
$query ="
SELECT uwc.ItemID, al.ItemName
FROM basket uwc
LEFT JOIN avatarlist al
ON al.ItemID = uwc.ItemID
WHERE uwc.UserSN = '$usersn'
ORDER BY uwc.BasketID
";
$check = $db->query($query);
$count = $db->num_rows($check);
if ($wannabuy == 1) {
mysql_close();
echo '<tr align="center"><td colspan="6"><B>购买物品后将会减去相应的M币,如果你已经购买过购物车里的服装,那么购买将不能被提交。<B><BR></td></tr>';
echo '<tr align="center"><td colspan="6"><input type="submit" class="button" name="submit" id="submit" value="提交购买"></input></td></tr>';
}else{
echo '<tr align="center"><td colspan="6"><B>您尚未在游戏中选购任何物品,请在游戏中将物品放到购物车上再到商城结帐!<B></td></tr>';
echo '<tr align="center"><td colspan="6" class="prompt"><img src="getcode.php"></td></tr>';
echo '<tr align="center"><td colspan="6"><a href="#" onclick="javascript:window.close()">关闭窗口</a></td></tr>';
mysql_close();
}
echo '</table>';
}
}
/* 检查提交的验证码 */
}
else {
ErrorLogin('您递交的验证码错误!!!!!!!!<br />请返回后重新填写');
}
/* 检查帐号密码数据是否含有非法数据 */
/* 检查ACCOUNT数据长度 */
/* 检查PASSWORD数据长度 */
/* 检查提交的数据是否为空 */
/* 第一个判断 */
function EndOfPage($ErrMsg)
{
ErrorLogin($ErrMsg);
die(0);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -