📄 default.asp
字号:
<%response.buffer=true%>
<%response.expires=-1%>
<!--#include file="config.asp"-->
<!--#include file="md5.asp"-->
<%
If request("menu")="out" Then
Session.abandon
End If
if Request("menu")="login" then
'过滤敏感字符及系统命名字符
xhao=Replace(Replace(Replace(Replace(Replace(Replace(Replace(trim(Request("xh")),"'","''"),"update",""),"insert",""),"and",""),"or",""),"del",""),"none","")
set rs=server.createobject("adodb.recordset")
sql="select * from T_Stu where xhao='"&xhao&"'"
rs.open sql,conn,1,3
If rs.bof and rs.eof and xhao<>"" then
'If isNaN(xhao) = false Then
' Response.write"<script language='javascript'>alert(""注册失败!\n\n帐号请填写学号!"");location.href=""edit.asp"";</script>"
' Response.End
'End If
If UserR_LocK = 0 Then
Conn.Execute("Insert into [T_Stu] (xhao,S_Pwd,S_Rschool,S_IP) values ('"&Request("xh")&"','"&md5(trim(Replace(Request("logpsw"),"'","")))&"','20"&left(Request("xh"),2)&"','"&Request.ServerVariables("REMOTE_ADDR")&"')")
Set Rs_NewUse=Conn.Execute("Select *From [T_Stu] where xhao='"&xhao&"'")
Session("id")=Rs_NewUse("id")
Session("name")="姓名尚未录入"
Session("S_Pwd")=md5(trim(Replace(Request("logpsw"),"'","")))
Session("xhao")=trim(Replace(Request("xh"),"'",""))
Session("nj")=1 '学生所在年级,刚注册默认为一年级
Session("Yz")=1 '学生所在年级,刚注册默认为一年级
Conn.Execute("Insert into [T_Log] (L_What,L_IP) values ('注册新用户:帐号"&Request("xh")&"','"&Request.ServerVariables("REMOTE_ADDR")&"') ")
Response.write"<script language='javascript'>alert(""注册成功!\n\n由于您第一次登录该系统,请先认真填写您的个人资料,以便统计结果!"");location.href=""edit.asp"";</script>"
Else
Response.write"<script language='javascript'>alert(""对不起!\n\n系统目前不接受用户注册!"");location.href=""default.asp"";</script>"
Response.End
End If
Else
If len(Rs("S_Pwd"))<>32 Then
Conn.Execute("Update [T_Stu] set S_Pwd='"&md5(Rs("S_Pwd"))&"' where xhao='"&xhao&"' ")
End If
if Rs("S_Pwd")=md5(trim(Replace(Request("logpsw"),"'",""))) then
Session("id")=rs("id")
Session("name")=rs("name")
Session("S_XClass")=Rs("S_XClass")
Session("S_Pwd")=rs("S_Pwd")
Session("xhao")=trim(Replace(Request("xh"),"'",""))
If DatePart("m",""&now()&"")>=8 Then
Session("nj")=DatePart ("yyyy",""&now()&"")-Rs("S_Rschool")+1 '学生所在年级
Else
Session("nj")=DatePart ("yyyy",""&now()&"")-Rs("S_Rschool") '学生所在年级
End If
Session("Yz")=rs("xy") '读出学生所有专业ID
count=rs("count")
count=count+1
rs("count")=count
Rs("S_IP")=Request.ServerVariables("REMOTE_ADDR")
rs("lastlogin")=now()
rs.update
If Rs("Count")=1 Then
Response.write"<script language='javascript'>alert(""由于您是第一次登录该系统,请先认真填写您的个人真实资料,以便统计结果!"");location.href=""edit.asp"";</script>"
Response.end
End IF
rs.close
set rs=nothing
Response.Redirect "Main.asp"
Response.end
else
Response.Write "<script language='javascript'>alert('对不起,帐号密码错误,请勿非法登陆!');history.back();</script>"
end if
End If
Else
%>
<html>
<head>
<title><%response.write webname%>选修课网上报名系统</title>
<link rel="stylesheet" type="text/css" href="images/vpei.css">
</head>
<body topmargin=10><a href=http://vpei.dxswm.com target=_blank><font color=#FFFFFF>VPEI</font></a>
<TABLE height=64 cellSpacing=1 cellPadding=3 width=400 bgColor=#000000 border=0 align=center>
<tr bgcolor=#FFFFFF><td background=images/cent.gif align=center height=25 class=topic colspan=2>用户登录入口</td></tr>
<form method="post" action="default.asp">
<input type="hidden" name="menu" value="login">
<tr bgcolor="#FFFFFF">
<td width='63%'><font color=red>登录说明</font>:请用学号登录,第一次登录时填入的学号密码,就是以后管理的帐号密码,登录后请<font color=red>认真填写真实资料</font>,该资料在成绩统计时使用。若您的学号不能登录请联系我们<BR>联系电话:511####(###)<br><br></td>
<td vAlign=center align=center class=txt>
<br>
学号: <input type="text" name="xh" size="10" maxlength="20" onkeyup=if(isNaN(this.value))this.value='请填写学号'>
<br><br>
密码: <input type="password" name="logpsw" size="10" maxlength="31">
<br><br></TD></TR>
<tr bgcolor="#FFFFFF"><td background=images/cent.gif align=center height=25 colspan=2><input type="submit" value="确 定"> <input type="reset" value="重 写"></td></tr>
</FORM>
</table><a href=http://vpei.dxswm.com target=_blank><font color=#FFFFFF>VPEI</font></a>
<%Call bottom()%>
</body></html>
<%
conn.close
set conn=nothing
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -