Response.End
End If
'将变量进行字符转换
str_username = replace(str_username,"'","''")
str_userpass = replace(str_userpass,"'","''")
(4)判断用户身份,根据不同的身份调用不同的数据表进行权限校验
if num_identity = 0 then '如果是教师
selectsql = "SELECT id,truename,state FROM loginusers WHERE username ='"&str_username&"' AND userpass='"&str_userpass&"'"
'response.write selectsql&"<br>"
set selectrs = Conn_login.Execute(selectsql)
if selectrs.eof and selectrs.bof then
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
alert("用户名或密码错误!请重新输入");
history.go(-1);
//-->
</SCRIPT>
<%
response.end
%>
//-->
</SCRIPT>
'将用户的基本信息放入session
session("userid")=selectrs("id")
session("identity")=num_identity
%>,
(5)跳到对应用户身份的主页面
<%
if num_identity = 0 then '教师登录
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location.href="index.asp";
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location.href="parent_view/index.asp";
//-->
</SCRIPT>
<%
Response.End
'Response.Write "登录成功: "
5.1.2 互动信息发布、接收及处理
(1)判断新邮件数
mysql="SELECT * FROM message_main where message_to='"&userid&"' and message_identist_to='"& get_identity(now_identity)& "' and state_to=0 order by message_time desc"
set myrs=open_rs(conn,mysql)
if not myrs.eof then
newcount=myrs.recordcount
else
newcount=0
end if
mysql="SELECTid,message_fromname,message_title,message_time,message_visited,message_from,message_identis
t_from,message_identist_to,state_to FROM message_main where message_to='"&userid&"' and message_identist_to='"& get_identity(now_identity)& "' and state_to<>2 order by message_time desc"
Set myrs = Open_RsAndPageSizeNoS(conn,mysql,10)'分页显示邮件记录
If myrs.EOF then
totalcount=0
maillist="<TABLE bgColor=#999999 border=0 cellPadding=1 cellSpacing=1 width='100%'>"
maillist=maillist& "<TBODY><TR bgColor=#ffffff>"
maillist=maillist& "<td nowrap class=td>"&username&",您目前没有任何邮件!</td>"
maillist=maillist& "</tr></tbody></table>"
else
totalcount=myrs.recordcount
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页