📄 char.asp
字号:
set re=Nothing
reUBBCode=strContent
end function
rem Get constellation from birthday.
function constellation(mon,da)
dim bir,birmon,birday
if len(mon)=1 then birmon="0"&mon else birmon=mon
if len(da)=1 then birday="0"&da else birday=da
bir=birmon&birday
if bir>="0120" and bir<="0218" then
constellation="水瓶座"
elseif bir>="0219" and bir<="0320" then
constellation="双鱼座"
elseif bir>="0321" and bir<="0419" then
constellation="白羊座"
elseif bir>="0420" and bir<="0520" then
constellation="金牛座"
elseif bir>="0521" and bir<="0621" then
constellation="双子座"
elseif bir>="0622" and bir<="0722" then
constellation="巨蟹座"
elseif bir>="0723" and bir<="0822" then
constellation="狮子座"
elseif bir>="0823" and bir<="0922" then
constellation="处女座"
elseif bir>="0923" and bir<="1023" then
constellation="天秤座"
elseif bir>="1024" and bir<="1121" then
constellation="天蝎座"
elseif bir>="1122" and bir<="1221" then
constellation="射手座"
elseif bir>="1222" or bir<="0119" then
constellation="摩羯座"
end if
end function
function IsValidEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
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
function IsValidTel(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
IsValidTel=false
exit function
end if
str=cstr(para)
if len(trim(str))<7 then
IsValidTel=false
exit function
end if
l=len(str)
for i=1 to l
if not (mid(str,i,1)>="0" and mid(str,i,1)<="9" or mid(str,i,1)="-") then
IsValidTel=false
exit function
end if
next
IsValidTel=true
if err.number<>0 then err.clear
end function
Function GetIp(IP)
ips=Split(ip,".")
GetIp=ips(0)&"."&ips(1)&".*.*"
end Function
'用户来源
function ipsource(sip)
if isnumeric(left(sip,2)) then
set iprs=server.createobject("adodb.recordset")
if sip="127.0.0.1" then sip="192.168.0.1"
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
ipsql="select Top 1 country,city from address where ip1 <="&num&" and ip2 >="&num&""
iprs.open ipsql,conn,1,1
if iprs.eof and iprs.bof then
country="亚洲"
city=""
else
country=iprs("country")
city=iprs("city")
end if
iprs.close
set iprs=nothing
end if
ipsource=country&city
else
ipsource="未知"
end if
end function
sub error(errmsg)
%><br><br>
<table cellpadding=0 cellspacing=0 border=0 width=90% bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>><font color="<%=TableFontColor%>"><b><%=version%>错误信息</b></font></td>
</tr>
<tr>
<td width="100%" bgcolor=<%=TablebodyColor2%> class=mp><font color="<%=TableContentColor%>"><br><b>产生错误的可能原因:</b><br><br>
<li>您是否仔细阅读了<a href=help.asp><font color="<%=TableContentColor%>">帮助文件</font></a>
<%=errmsg%><br><br></font>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>>
<a href="javascript:history.go(-1)"><font color="<%=TableFontColor%>"> << 返回上一页</font></a>
</td>
</tr>
</table> </td></tr></table>
<%
end sub
sub success(byval suctitle,byval sucmsg)
%>
<link href="include/site.css" type="text/css" rel="stylesheet">
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" align=center bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>成功:<%=suctitle%></td>
</tr>
<tr>
<td width="100%" bgcolor=<%=tablebodycolor2%>><br> <%=sucmsg%></b><br><br>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>
<a href="javascript:history.go(-1)"> << 返回上一页</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
function ChkPost()
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
end if
end function
function getrealname(byval username)
tmpsql = "select realname from [student] where userid='"&username&"'"
set tmprs=conn.execute(tmpsql)
if not tmprs.eof then
getrealname=tmprs(0)
else
getrealname=null
end if
end function
Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
function Is_odd(num)
n=num mod 2
if n=1 then
Is_odd=true
else
Is_odd=false
end if
end function
'错误信息提示
sub disperrs()
%>
<html><head>
<meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312>
<title><%=version%>——登录失败</title>
<link rel=stylesheet type=text/css href=include/site.css>
</head>
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=90% bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>><font color="<%=TableFontColor%>"><b><%=version%>错误信息</b></font></td>
</tr>
<tr>
<td width="100%" bgcolor=<%=TablebodyColor2%> class=mp><font color="<%=TableContentColor%>"><br><b>产生错误的可能原因:</b><br><br>
<li>您是否仔细阅读了<a href=help.asp><font color="<%=TableContentColor%>">帮助文件</font></a>
<%=errormsg%><br><br></font>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>>
<a href="javascript:history.go(-1)"><font color="<%=TableFontColor%>"> << 返回上一页</font></a>
</td>
</tr>
</table> </td></tr></table>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -