📄 userlogin.php
字号:
<?php
require_once('libs/session.inc');
?>
<html>
<head>
<title>会员登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.input2 {
BORDER-RIGHT: #999999 1px solid;
BORDER-TOP: #999999 1px solid;
FONT-SIZE: 9pt;
BORDER-LEFT: #999999 1px solid;
COLOR: #000000;
BORDER-BOTTOM: #999999 1px solid;
FONT-FAMILY: "宋体";
}
TD {
FONT-SIZE: 9pt;
LINE-HEIGHT: 150%;
FONT-FAMILY: 宋体;
}
body {
margin :0;
}
a {text-decoration : none;
color:#0000CC }
a:hover {text-decoration : underline;
color : #FF9900;
}
</style>
</head>
<body>
<?php
function getwelcom(){
$d = date("H");
if($d<6){
echo "凌晨好!";
}
elseif($d<9){
echo "早上好!";
}
elseif($d<12){
echo "上午好!";
}
elseif($d<15){
echo "中午好!";
}
elseif($d<19){
echo "下午好!";
}
else{
echo "晚上好!";
}
}
function msgbox($str,$type,$scr)
{
echo "<script language=javascript>";
echo "alert('".$str."');";
switch ($type)
{
case "Back";
echo "history.go(-1);";
break;
case "GoUrl";
echo "window.location='".$scr."'";
break;
case "Close";
echo "window.close()";
break;
}
echo "</script>";
}
if(!empty($_SESSION['last_time'])){
$nowtime = time();
$lasttime = $_SESSION['last_time'];
$mid = $nowtime - $lasttime;
if($mid>7200){
session_unregister('last_time');
session_unregister('username');
msgbox("登陆超时,请重新登陆!",Back,"");
}
}
if(!empty($_SESSION['username']))
{
require_once('libs/config.inc');
require_once('libs/dbmanager.inc');
$conn = DBManager::getConnection();
$sql = "SELECT * FROM ".$tablepre."user WHERE username='".$_SESSION['username']."'";
if($result = $conn->query($sql)){
$username = $_SESSION['username'];
$obj = $result->fetch_object();
$times = $obj->usertimes;
$mark = $obj->usermark;
$mail = $conn->query("SELECT * FROM ".$tablepre."passagemail WHERE pmto = '$username' AND pmisnew ='1'");
while($mail->fetch_assoc()){
$newnum++;
}
}
echo "<table height=130 width='100%' align='center' background='skin/login_bak.jpg'>";
echo "<tr><td align = 'center'>";
echo getwelcom();
echo "<font color=red>".$username."</font>";
echo "<br>共登陆:".$times."次";
echo "<br> 积分:".$mark."分";
echo "<br>新短信息:<font color=blue>".$newnum."</font>条";
echo "<a href='user/user_mail.php?action=from' target='_blank'><img src='skin/smallpic/mail.gif' border='0'></a>";
echo "<br><img src='skin/smallpic/60.gif'> <font color=blue><b><a href='user_map.php' target='_parent'>[我的管理中心]</a></b></font>";
echo "</td></tr><tr><td align='center'><a href='userchk.php?action=logouts'>注销</a>";
echo "</td></tr></table>";
}
else
{
echo "<form name='login' method='post' action='userchk.php'>";
echo "<table height=130 width='100%' align='center' background='skin/login.jpg'>";
echo "<tr><td height=30></td></tr>";
echo "<tr>";
echo "<td align='right'>";
echo "用户名:";
echo "</td>";
echo "<td>";
echo "<input class='input2' size='14' maxlength='30' name='username'>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right'>密码:</td>";
echo "<td><input class='input2' type='password' size='14' maxlength='40' name='userpwd'></td>";
echo "</tr><tr>";
echo "<td align='right'>验证码:</td>";
echo "<td><input class='input2' size='4' maxlength='5' name='mycode'><img src='js/code.php'></td>";
echo "</tr><Tr>";
echo "<td align='center' colspan='2'><input type='hidden' name='message' value='ok'><input type='image' src='skin/login_but.gif' name='login'> <a href='user/reg_user.php' target='_parent'><img border=0 src='skin/riger_user.gif'></a></td>";
echo "</Tr></table></form>";
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -