📄 manage.php
字号:
<?php
include_once("include/conn.php");
include_once("include/config.php");
include_once("include/function.php");
//提交登录
if (isset($btn_login))
{
$rs = @new COM("ADODB.RecordSet");
$rs->Open("select top 1 * from gb_admin where adm_name='$user_name'",$conn,1,3);
if (!$rs->eof){
$user_pass=substr(md5($user_pass),8,16);
if ($rs->Fields["adm_pass"]->Value==$user_pass)
{
setcookie("admin_id",$rs->fields["id"]->Value);
setcookie("admin_login",$rs->fields["adm_name"]->Value);
$rs->Fields["adm_logintimes"]->Value=$rs->fields["adm_logintimes"]->Value+1;
$rs->Fields["adm_lastlogin"]->Value=gettime();
$rs->Fields["adm_loginip"]->Value=getip();
$rs->update;
alert("登录成功!","index.php");
exit;
}
else
{
echo alert("密码错误!",1);
}
}
else
{
echo alert("用户名不存在!",1);
}
$rs->close();
$rs=null;
}
//管理操作
$action=$_GET["action"];
if ($action!="")
{
$id=chkint($_GET["id"]);
switch ($action)
{
case "setpass":
$conn->execute("update gb_main set gb_show=1 where id=".$id);
break;
case "notpass":
$conn->execute("update gb_main set gb_show=0 where id=".$id);
break;
case "setdel":
$conn->execute("delete from gb_main where id=".$id);
break;
default:
break;
}
header ("location:".$_SERVER["HTTP_REFERER"]);
}
$conn->close();
$conn=null;
?>
<?php if($_COOKIE["admin_login"]==""){ ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言管理--<?php echo $cfg_name; ?></title>
<link href="skin/<?php echo $cfg_skin; ?>.css" rel="stylesheet" type="text/css">
<meta name="keywords" content="<?php echo $cfg_keywords; ?>">
<meta name="description" content="<?php echo $cfg_description; ?>">
</head>
<body>
<!--登录开始-->
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" height="20"><img src="skin/<?php echo $cfg_skin; ?>/top_left.gif" width="30" height="20"></td>
<td background="skin/<?php echo $cfg_skin; ?>/top_mid.gif"> </td>
<td width="30"><img src="skin/<?php echo $cfg_skin; ?>/top_right.gif" width="30" height="20"></td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" class="td_border">
<tr>
<td align="center">
<table width="60%" border="0" cellspacing="0" cellpadding="0">
<form name="frm_login" method="post" action="<?php echo $PHP_SELF; ?>">
<tr>
<td height="28" align="center">用户名:
<input name="user_name" type="text" class="frm_input" id="user_name" maxlength="20" style="width:120px">
</td>
</tr>
<tr>
<td height="28" align="center">密 码:
<input name="user_pass" type="password" class="frm_input" id="user_pass" maxlength="50" style="width:120px">
</td>
</tr>
<tr>
<td height="28" align="center">
<input name="btn_login" type="submit" class="frm_button" id="btn_login" value=" 登 录 ">
<input name="btn_back" type="button" class="frm_button" id="btn_back" onClick="history.back()" value=" 返 回 ">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" height="15"><img src="skin/<?php echo $cfg_skin; ?>/bom_left.gif" width="30" height="15"></td>
<td background="skin/<?php echo $cfg_skin; ?>/bom_mid.gif"> </td>
<td width="30"><img src="skin/<?php echo $cfg_skin; ?>/bom_right.gif" width="30" height="15"></td>
</tr>
</table>
<!--登录结束-->
</body>
</html>
<?php } ?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -