?? top_index.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*"%>
<html>
<head>
<title>新聞發布系統</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function login()
{
if(login_form.user.value.length == 0 || login_form.psw.value.length == 0)
{
alert("登陸用戶名或密碼為空");
}
else
{
login_form.submit();
}
}
function register()
{
window.open("register.jsp",width=800,height=600);
}
</script>
</head>
<body>
<%
String name = (String)session.getAttribute("username");
if(name == null || name.length() == 0)
{
%>
<table>
<form name="login_form" action="login.jsp">
<tr>
<td width="30" class="text-login" valign="right">用戶:</td>
<td width="100" class="text-login"><input type=text name="user" class="inputlength120" maxlength="20"></td>
<td width="20"> </td>
<td width="30" class="text-login" valign="right">密碼:</td>
<td width="100" class="text-login"><input type="password" name="psw" class="inputlength120" maxlength="20"></td>
<td width="200" ><img src="image/login.gif" onclick="login()"><img src="image/reg.gif" onclick="register()"></td>
</tr>
</form>
</table>
<%
}
else
{
String priority = (String)session.getAttribute("priority");
%>
<table>
<tr>
<td colspan="2" align="center">歡迎
<%
if("1".equals(priority))
{
out.print("普通用戶");
}
if("2".equals(priority))
{
out.print("新聞員");
}
if("3".equals(priority))
{
out.print("管理員");
}
%>
<%=name%></td>
<td width="20%" align="right"><a href="logout.jsp">注銷</a></td>
</tr>
</table>
<%
}
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -