📄 char.asp
字号:
<%
Rem ==========通用函数设定=========
'页面错误提示信息
sub txl_error()
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td bgcolor=<%=txl_body(10)%>><br>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1 style="width:75%">
<tr>
<th width="100%" height=25 colspan=2 align=center>同学录错误信息</th>
</tr>
<tr>
<td width="100%" class=tablebody1 colspan=2><b>产生错误的可能原因:</b><br><br>
<li>您是否仔细阅读了<a href="help.asp">帮助文件</a>,可能您还没有登陆或者不具有使用当前功能的权限。
<%=errmsg%></td>
</tr>
<tr>
<td class=tablebody2 valign=middle colspan=2 align=center><a href="<%=Request.ServerVariables("HTTP_REFERER")%>"><<返回上一页</a></td>
</tr>
</table><br>
</td>
</tr>
</table>
<%
end sub
sub txl_suc()
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td bgcolor=<%=txl_body(10)%>><br>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1 style="width:75%">
<tr>
<th height=25 width="100%" align=center>同学录成功信息</th>
</tr>
<tr>
<td width="100%" class=tablebody1><b>操作成功:</b><br><br><%=sucmsg%></td>
</tr>
<tr align=center>
<td width="100%" class=tablebody2><a href="<%=Request.ServerVariables("HTTP_REFERER")%>"> << 返回上一页</a></td>
</tr>
</table><br>
</td>
</tr>
</table>
<%
end sub
rem 过滤BadWord字符
function ChkBadWords(fString)
dim bwords,ii
if not(isnull(BadWords) or isnull(fString)) then
bwords = split(BadWords, "|")
for ii = 0 to ubound(bwords)
fString = Replace(fString, bwords(ii), string(len(bwords(ii)),"*"))
next
ChkBadWords = fString
end if
end function
Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
fString=ChkBadWords(fString)
HTMLEncode = fString
end if
end function
Rem 过滤表单字符
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLcode = fString
end if
end function
Rem 判断是否来自外部
function ChkPost()
dim server_v1,server_v2
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
Rem 判断用户来源
function address(sip)
dim str1,str2,str3,str4
dim num
dim country,city
dim irs
if isnumeric(left(sip,2)) then
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
sql="select Top 1 country,city from address where ip1 <="&num&" and ip2 >="&num&""
set irs=server.createobject("adodb.recordset")
irs.open sql,conn,1,1
if irs.eof and irs.bof then
country="亚洲"
city=""
else
country=irs(0)
city=irs(1)
end if
irs.close
set irs=nothing
end if
address=country&city
else
address="未知"
end if
end function
function iif(expression,returntrue,returnfalse)
if expression=0 then
iif=returnfalse
else
iif=returntrue
end if
end function
function iiif(express,expression,returntrue,returnfalse)
if express>expression then
iiif=returnfalse
else
iiif=returntrue
end if
end function
function iimg(expression,returnfalse,returntrue)
if expression="" or isnull(expression) then
iimg=returnfalse
else
iimg=returntrue
end if
end function
Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
Rem 用户在线
sub foot()
endtime=timer()
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px;">
<tr>
<td width="<%=txl_body(0)%>" height="32" background="<%=txl_info(7)%>bj.gif"> </td>
</tr>
<tr>
<td width="<%=txl_body(0)%>" bgcolor="<%=txl_body(9)%>"><%=txl_body(24)%></td>
</tr>
<tr>
<td width="<%=txl_body(0)%>" height="50" align=center bgcolor="<%=txl_body(10)%>"><%=Version%><br><%=Copyright%>
</tr>
</table>
</body>
</html>
<%
CloseDatabase
end sub
sub head()
%>
<html>
<head>
<META http-equiv=Content-Type content=text/html; charset=gb2312>
<meta name=keywords content="红雨同学录,mathren.com">
<title><%=txl_info(0)%>--<%=htmlencode(stats)%></title>
<!--#include file="txl_css.asp"-->
<!--#include file="txl_js.asp"-->
</head>
<body topmargin=0 onmousemove="HideMenu()">
<div id=menuDiv style='Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8'></div>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td width="<%=txl_body(0)%>"><%=txl_body(22)%></td>
</tr>
<tr>
<td width="<%=txl_body(0)%>" height="9" background=<%=txl_info(6)&txl_skinpic(0)%>></td>
</tr>
<tr>
<td width="780" height="22" background=<%=txl_info(6)&txl_skinpic(1)%>>
<%if not founduser then%>
<a href="login.asp">登陆</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle>
<a href="register.asp">注册</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle>
<%end if%>
<a href="index.asp">班级首页</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="g_index.asp" onMouseOver='ShowMenu(gbooklist,80)'>班级留言</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="b_index.asp" onMouseOver='ShowMenu(bbslist,80)'>班级论坛</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="p_index.asp" onMouseOver='ShowMenu(photolist,80)'>班级相册</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="c_index.asp" onMouseOver='ShowMenu(cardlist,80)'>班级名片</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="u_index.asp" onMouseOver='ShowMenu(userlist,80)'>个人菜单</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
href="s_index.asp" onMouseOver='ShowMenu(shequlist,80)'>班级社区</a> <img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a
<a href="help.asp">在线帮助</a>
<%if supermaster then%>
<img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a href="admin_index.asp">管理</a>
<%end if%>
<%if founduser then%>
<img src=<%=txl_info(7)%>spacer.gif align=absmiddle> <a href="logout.asp">退出</a> </td>
<%end if%>
</tr>
</table>
<%
if Cint(GroupSetting(0))=1 and (instr(scriptname,"register.asp")=0 and instr(scriptname,"login.asp")=0) then
Errmsg=Errmsg+"<br>"+"<li>您没有浏览本同学录的权限,请<a href=login.asp>登陆</a>后浏览或者同管理员联系。"
call head_var("错误信息","")
call txl_error()
call foot()
response.end
end if
end sub
sub head_var(GetTitle,GetUrl)
%>
<table width="<%=txl_body(0)%>" cellpadding=3 cellspacing=0 align=center style="border:1px <%=txl_body(9)%> solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td height=30 valign=middle bgcolor=<%=txl_body(10)%>> <img src=<%=txl_info(7)%>dot01.gif border=0> <a href=index.asp>班级首页</a> → <a href=<%=GetUrl%>><%=GetTitle%></a> → <%=HTMLEncode(stats)%></td>
</tr>
</table>
<%
end sub
'统计短信
function newincept()
rs=conn.execute("Select Count(id) From Message Where flag=0 and issend=1 and delR=0 And incept='"& membername &"'")
newincept=rs(0)
set rs=nothing
if isnull(newincept) then newincept=0
end function
function inceptid(stype)
set rs=conn.execute("Select top 1 id,sender From Message Where flag=0 and issend=1 and delR=0 And incept='"& membername &"'")
if stype=1 then
inceptid=rs(0)
else
inceptid=rs(1)
end if
set rs=nothing
end function
Rem 判断数字是否整形
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -