📄 checkidpwd.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@page import="bean.check.Checkinfo_idpwd"%>
<%@page import="bean.readdb.DBRead"%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title></head><body><%
//连接数据库
java.sql.Connection conn;
int s=-1;//标志位
%>
<jsp:useBean id="bbscon" scope="session" class="bean.condb.Condb" />
<%
conn=bbscon.con();
%>
<%
String name = new String();
String author ="";
name = new String(request.getParameter("ID").getBytes("iso-8859-1"),"GB2312");
String pwd = new String(request.getParameter("pwd").getBytes("iso-8859-1"),"GB2312");
%>
<jsp:useBean id="checklogin" scope="session" class="bean.check.Checkinfo_idpwd" />
<jsp:useBean id="getauthor" scope="session" class="bean.readdb.DBRead" />
<%
s = checklogin.Check_login(conn,name,pwd);
%>
<%
if(s==0){
%>
<a href="login.jsp" >用户名无效,返回重新登录</a>
<%}
else if(s==2){
%>
<a href="login.jsp" >密码错误,返回重新登录</a>
<%}
else if(s==1){//版主
session.setAttribute("name",name);
author = getauthor.DBReader_author(name);
session.setAttribute("author",author);
session.setAttribute("control","1");
%>
<a href="index.jsp" >登陆成功,点击返回主页</a>
<%}
else if(s==3){//普通用户
session.setAttribute("name",name);
author = getauthor.DBReader_author(name);
session.setAttribute("author",author);
session.setAttribute("control","0");
%>
<a href="index.jsp" >登陆成功,点击返回主页</a>
<%}
else if(s==4){//超级用户 管理员
session.setAttribute("name",name);
author = getauthor.DBReader_author(name);
session.setAttribute("author",author);
session.setAttribute("control","2");
%>
<a href="index.jsp" >登陆成功,点击返回主页</a>
<%} %></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -