📄 function.asp
字号:
<!-- #include file="conn.asp" -->
<%
dim action
action=Request.Form("action")
if action = empty then action = Request("action")
set rs=server.createobject("ADODB.Recordset")
sql="select * FROM forumconfig"
rs.open sql,conn,1,1
forumname=rs("forumname")
forumurl=rs("forumurl")
homepage=rs("homepage")
homeurl=rs("homeurl")
perpage=rs("perpage")
wmhtmlkzn=rs("wmhtmlkzn")
badwords=rs("badwords")'不良词用|分开
badip=rs("badip")'禁止的IP用|分开
affichemsg=rs("affichemsg")'公告
adduseryn=rs("adduseryn")
contentlen=rs("contentlen")
PostTime=rs("PostTime")
RegTime=rs("RegTime")
ifmodifytime=rs("ifmodifytime")
rs.Close
set rs=nothing
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")=empty then
remoteaddr=Request.ServerVariables("REMOTE_ADDR")
else
remoteaddr=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
if badip<>empty then
filtrate=split(badip,"|")
for i = 0 to ubound(filtrate)
if instr("|"&remoteaddr&"","|"&filtrate(i)&"") > 0 then error("<li>你的IP被禁止查看本论坛")
next
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function ReplaceText(fString,patrn, replStr)
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分大小写。
regEx.Global = True ' 设置全局可用性。
ReplaceText = regEx.Replace(fString, replStr) ' 作替换。
End Function
function HTMLEncode(fString)
fString=replace(fString,";",";")
fString=replace(fString,"<","<")
fString=replace(fString,">",">")
fString=replace(fString,"\","\")
fString=replace(fString,"--","--")
fString=replace(fString,"'","'")
fString=replace(fString,CHR(9)," ") 'table
fString=replace(fString,CHR(32)," ")
fString=replace(fString,CHR(34),""")
fString=replace(fString,vbCrlf,"<br>")
HTMLEncode=fString
end function
function ContentEncode(fString)
'fString=replace(fString,vbCrlf, "")
fString=replace(fString,"\","\")
fString=replace(fString,"'","'")
fString=ReplaceText(fString,"<(.[^>]*)(&#|cookie|window.|Document.|javascript:|js:|vbs:|about:|file:|on(blur|click|change|Exit|error|focus|finish|key|load|mouse))", "<$1$2$3")
fString=ReplaceText(fString,"<(\/|)(iframe|object|SCRIPT|form|style|meta)", "<$1$2")
ContentEncode=fString
end function
sub error(message)
%><script>alert('<%=message%>');history.back();</script><script>window.close();</script>
<%
responseend
end sub
sub responseend
set rs=nothing
set rs1=nothing
set conn=nothing
Response.End
end sub
Function Lenc(num1,num2) '获得num1比num2长出的位数
Dim n1,n2,n
Dim str1,str2
str1="abc"
str2="abc"
'On Error Resume Next
n=Instr(1,num1,".")
If n=0 then
n1=0
Else
n1=Len(num1)-n
End If
n=Instr(1,num2,".")
If n=0 then
n2=0
Else
n2=Len(num2)-n
End If
Lenc=n1-n2
If Lenc<0 then
Lenc=0
End If
Lenc=fix(Lenc/2)
End Function
Function Cnum(str) '强制转换为整数
If isnumeric(str)=false then
Cnum=0
Else
Cnum=clng(str)
End If
End Function
Function mint(str) '取大于或等于此数的最小整数
If str-fix(str)<>0 then
mint=fix(str)+1
Else
mint=fix(str)
End If
End Function
sub succeed(message)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统信息</title>
<style>
<--
BODY{font-size:9pt;}
td { font-size: 9pt}
-->
</style>
</head>
<body topmargin="50">
<table width="413" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="29" colspan="3" background="images/topbg.gif">
<table width="95%" align="right" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="76%" align="left" valign="middle"><font color="#FFFFFF"><B>系统提示</B></font></td>
<td width="24%" align="right"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="3" background="images/link.GIF"></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="74">
<table width="100%" height="74" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" height="74" align="left" valign="bottom"> <font color="#FFFFFF"><img src="images/errtopbg.gif" width="409"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table width="100%" border="0" align="center" bgcolor="#EEEAD6">
<tr>
<td height="144" valign="top">
<fieldset>
<legend accesskey="F" align="left" >系统提示</legend>
<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0"height="120">
<tr>
<td height="100" valign="top"><br><%=message%></td>
</tr>
<tr>
<td height="2"> </td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="3" background="images/link.GIF"></td>
</tr>
<tr><td height="3" background="images/linkbom.GIF" colspan="3"></td></tr>
</table>
</body>
</html>
<%
Response.End
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -