mem_login.jsp

来自「JSP课件以及一个网上书店系统程序,带数据库」· JSP 代码 · 共 54 行

JSP
54
字号
<%@ page contentType="text/html; charset=gb2312" %>
<%@ include file="inc/conn.jsp"%>
<link href="style1.css" rel="stylesheet" type="text/css" />
<%
//是否登陆
if((String)session.getValue("nick")!=null) 
 {
 %>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" ID="Table4">
	<tr>
		<td width="14" height="38" align="right" valign="top"><img src="pic/position.jpg" width="12" height="38" /></td>
		<td width="116" background="pic/position_line.jpg"><img src="pic/memberLogin.jpg" width="116" height="33" /></td>
		<td background="pic/position_line.jpg" class="search_field">
			<div class="search_form">
				<%=session.getValue("userid")%>
				&nbsp; User,<%=session.getValue("nick")%>已登录&nbsp;&nbsp;<a class="grey" href="#">修改资料
				</a>| <a class="grey" href="mem_Login.jsp?loginout=true">退出系统</a>
			</div>
		</td>
		<td width="15" class="ProductText"><img src="pic/position_End.jpg" width="12" height="38" /></td>
	</tr>
</table>
<%
  }else{ //没有登陆 
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" ID="Table1">
	<form action="memcheckLogin.jsp" name="Form1" ID="Form1">
		<tr>
			<td width="14" height="38" align="right" valign="top"><img src="pic/position.jpg" width="12" height="38" /></td>
			<td width="116" background="pic/position_line.jpg"><img src="pic/memberLogin.jpg" width="116" height="33" /></td>
			<td background="pic/position_line.jpg" class="search_field">
				<div class="search_form">&nbsp; UID <input name="uid" type="text" class="search" id="uid" size="10" />
					PWD <input name="pwd" type="password" class="search" id="pwd" size="10" /> <input type="submit" value="Login" class="submit" ID="Submit1" NAME="Submit1" />
					<a href="#">注册会员</a>|<a href="#">忘记密码</a>
				</div>
			</td>
			<td width="15" class="ProductText"><img src="pic/position_End.jpg" width="12" height="38" /></td>
		</tr>
	</form>
</table>
<%  }
//判断登陆结束-退出系统
String loginout=request.getParameter("loginout");//退出登陆
	if(loginout!=null)
	{
		if(loginout.compareTo("true")==0)
		{
			session.removeAttribute("nick");
			session.removeAttribute("userid");
			//response.sendRedirect("index.jsp");
			response.sendRedirect("mem_Login.jsp");
		}
	}
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?