📄 login.jsp
字号:
<%
/**
* Title:Lerx计数器(JSP+MySQL)
* Description:含有动网最新IP数据库 165501条 2004年11月5日更新,我找到的最新的也最合适的就是这个了,花了些时间处理导入到MySQL里。
* Copyright: Copyright (c) 2005
* Company:www.lerx.com,www.5z.com.cn,www.huafang.com.cn
* @author:lzh@5z.com.cn() QQ:27723812
* @version 1.0
* 开发平台:红旗Linux4.1,JDK 1.5.0_04-b05,Tomcat 5.5.9,MySQL 3.23.58
* 完成时间:2005.12.2
*/
%>
<%@ page contentType="text/html;charset=gb2312" %>
<jsp:useBean id="MD5" scope="page" class="forum.MD5" />
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.sql.*" %>
<%@ include file="const.jsp" %>
<%@ include file="conn.jsp" %>
<%
String ps_id,ps_password,ps_SQLCmd="",ps_error,ps_VerifyCode,ps_RandVerifyCode,ps_GRSN,ps_err;
boolean pb_continue,pb_admin=false;
Random random = new Random();
int pi_number = random.nextInt(100);
ps_error="";
pb_continue=false;
ps_id = request.getParameter("id");
ps_password = request.getParameter("password");
ps_VerifyCode = request.getParameter("verifycode");
ps_GRSN = request.getParameter("GRSN");
if (ps_VerifyCode == null)
{
ps_VerifyCode="";
}
else
{
ps_VerifyCode=ps_VerifyCode.trim();
}
ps_RandVerifyCode = (String)session.getAttribute("statadmin@"+ps_GRSN);
ps_err=ps_RandVerifyCode;
if (ps_id == null){
ps_id="";
}
else
{
ps_id=ps_id.trim();
}
if (ps_password == null){
ps_password="";
}
else
{
ps_password=ps_password.trim();
ps_password = MD5.getMD5ofStr(ps_password);
}
if (ps_VerifyCode.equals(ps_RandVerifyCode)) {
if ((ps_id.equals(ps_Admin))&&(ps_password.equals(ps_AdminPassword)))
{
pb_admin=true;
pb_continue=true;
}
else
{
//检查数据库
ps_SQLCmd="select * from statuser where id='"+ps_id+"' and password='"+ps_password+"'";
rs=stmt.executeQuery(ps_SQLCmd);
if (rs.next())
{
pb_continue=true;
}
}
}
%>
<%@ include file="disconn.jsp" %>
<%
if (pb_continue)
{
if (pb_admin)
{
session.setAttribute("statadmin","true");
%>
<meta http-equiv=refresh content=0;url=./userlist.jsp>
<%
}
else
{
%>
<meta http-equiv=refresh content=0;url=./infmodify.jsp?id=<%=ps_id%>>
<%
}
}
else
{
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>记数器信息管理登录</title>
</head>
<body bgcolor="<%=ps_BgColor%>" text="#FFFFFF" link="#FFFFCC" vlink="#FFFFCC" alink="#CCCCFF">
<div align="center">
<center>
<table border="0" width="750" border="1" height="100%" bgcolor="<%=ps_TableColor%>">
<tr>
<td width="100%" valign="middle" align="center">
<form method="POST" action="./login.jsp?GRSN=<%=pi_number%>">
<table border="0" width="100%">
<tr>
<td width="100%" align="center" colspan="2"><b>记数器信息管理登录</b></td>
</tr>
<tr>
<td width="100%" align="center" height="40" colspan="2"></td>
</tr>
<tr>
<td width="100%" align="center" height="20" colspan="2"></td>
</tr>
<tr>
<td width="40%" align="right">用户名:</td>
<td width="60%"><input type="text" name="id" tabindex="1" size="20" value="<%=ps_id%>"></td>
</tr>
<tr>
<td width="40%" align="right">密 码:</td>
<td width="60%"><input type="password" name="password" tabindex="2" size="20"></td>
</tr>
<tr>
<td width="40%" align="right">附加码:</td>
<td width="60%"><input name="verifycode" size="10"> <img src="./verifycode.jsp?grsn=<%=pi_number%>"></td>
</tr>
<tr>
<td width="100%" align="center" height="40" colspan="2"><input type="submit" value="提交" name="B1">
</td>
</tr>
<tr>
<td width="100%" height="20" align="center" colspan="2"></td>
</tr>
<tr>
<td width="100%" align="center" colspan="2"><%@ include file="./copyright.jsp" %></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
<%
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -