www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/function.asp

    <%
'---------------------检查用户名密码-------------------------------
function Checkin(s) 
s=trim(s) 
s=replace(s," ","&amp;nbsp;") 
s=replace(s,"'","&amp;#39;") 
s=replace(s,"""","&amp;quot;") 
s=replace(s,"&lt;","&amp;lt;") 
s=replace(s,"&gt;","&amp;gt;") 
Checkin=s 
end function 
'---------------------检查初级管理员-------------------------------
function CheckAdmin1
	if Session("IsAdmin")<>true then response.redirect "admin_login.asp"
end function
'---------------------检查中级管理员-------------------------------
function CheckAdmin2
	if Session("IsAdmin")<>true or (session("KEY")<>"check" and session("KEY")<>"super") then response.redirect "admin_login.asp"
end function
'---------------------检查高级级管理员-------------------------------
function CheckAdmin3
	if Session("IsAdmin")<>true or session("KEY")<>"super" then response.redirect "admin_login.asp"
end function
'---------------------检查用户Email-------------------------------
function IsValidEmail(email)
IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if
end function
'---------------------错误输出-------------------------------
sub error()
%>
<!--#include file="conn.asp"-->
<html>
<head><title>错误信息提示==<%=WebTitle%></title></head>
<LINK href="images/CSS.css" type=text/css rel=stylesheet>
<body topmargin="0" leftmargin="0" rightmargin="0">
<TABLE cellSpacing=0 cellPadding=0 width="50%" 
              border=0  align="center">
<TR>
<TD colSpan=2><IMG height=8 src="images/23.gif" 
                width="100%"></TD></TR>
<TR>
<TD background=images/25.gif colSpan=2 height=18>
<TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
<TBODY>
<TR>
<TD width=10 rowSpan=2> </TD>
<TD width=15 rowSpan=2><IMG height=9 
                        src="images/28.gif" width=9></TD>
<TD class=zt00>错误信息:</TD></TR>
<TR>
<TD class=kg02> </TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD width=100% bgColor=#CCCCCC>
<table cellpadding=3 cellspacing=0 border=1 width=50% style="border-collapse: collapse" bordercolor="#CCCCC1">
<tr> 
<td class=zt00 width="100%">产生错误的可能原因:<%=errmsg%></font></td>
</tr>
<tr align="center">
<td class=zt00 width="100%"><a href="index.asp"> 
返回首页</a></td>
</tr>  
</table>
</TD></TR>
<TR>
<TD background=images/25.gif colSpan=2 
              height=18> </TD></TR>
<TR>
<TD colSpan=2><IMG height=7 src="images/24.gif" 
                width="100%"></TD></TR>
</TABLE>
</html>
<%
end sub
%>