?? login.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="xuanke.asp" -->
<!--#include file="include/exit.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登錄</title>
<style type="text/css">
<!--
@import url("style.css");
body {
background-image: url(image/back.jpg);
}
-->
</style>
</head>
<%
'接收表單數據----------------
id_no=request.Form("id_no")
s_pw=request.Form("s_pw")
studentgrade=request.Form("studentgrade")
'打開用戶數據庫并按照用戶ID和密碼查找用戶----------------
set rs_user=server.CreateObject("adodb.recordset")
sql="select * from student where id_no = '" & id_no & "'and s_pw='"& s_pw &"'"
rs_user.open sql,xuanke_conn,3,2
if not(rs_user.eof or rs_user.bof) then
if studentgrade="" then
%>
<%Response.Redirect "error.asp"%>
<%
else
rs_user("studentgrade")=studentgrade
rs_user.update
'找到用戶記錄session信息---------------------
session("id_no")=rs_user("id_no")
session("s_pw")=rs_user("s_pw")
haveerr=0
end if
else
'用戶不存在-----------------------
haveerr=1
end if
%>
<body>
<div align="center">
<%if session("s_pw")="123456" then%>
<script language="javascript">
<!--
alert("進入系統后請及時更改學號否則你將不能正常選課!");
-->
</script>
<%response.Redirect("pwedit.asp")%>
<%else%>
<script language="javascript">
<!--
alert("歡迎進入本系統!");
-->
</script>
<%end if%>
<table width="706" height="281" border="0" class="table_big">
<tr>
<td valign="top"><div align="center">
<!--#include file="include/head.asp" -->
<%
'登錄成功---------------
if haveerr=0 then
%>
<br>
<table width="400" border="0" class="table_small">
<tr>
<td background="image/type_bg.gif" class="text_title"> </td>
</tr>
<tr>
<td class="text_title"><div align="left">登錄成功,歡迎光臨!</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text"><div align="left">您可以選擇回到<a href="index.asp">首頁</a>或者<a href="course.asp">查看課程</a>進行選課或著<a href="pwedit.asp">修改密碼</a>。</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<% else %>
<br>
<table width="400" border="0" class="table_small">
<tr>
<td background="image/type_bg.gif" class="text_error"> </td>
</tr>
<tr>
<td width="391" class="text_error"><div align="left">出現錯誤!</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text"><div align="left">新輸入的身份證或密碼錯誤,請<a href="index.asp">返回</a>首頁重新登錄。</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<% end if %>
<br>
<!--#include file="include/foot.asp" -->
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -