📄 config.asp
字号:
<%
'定义全局变量
dim sitename,siteurl,siteemail,adminname,logourl,bannerurl
dim SMTPserver,EmailSuport,SiteTitle
set rs=conn.execute("select * from config")
sitename=rs("sitename") '系统名称
siteUrl=rs("siteurl") '系统网址
SiteTitle=rs("SiteTitle") ' 网站标题
SiteEmail=rs("siteemail") '管理员邮件
adminname=rs("adminname") '管理员名称
logourl=rs("logourl") 'Logo地址
bannerurl=rs("bannerurl") 'Banner地址
SMTPserver=rs("SMTPserver") '邮件服务器地址
EmailSuport=rs("EmailSuport") '邮件组件支持
rs.close:set rs=nothing
sub mb(byval txt,byval url,byval go)
response.write "<script language=Javascript>alert('"&txt&"');"
if go<>1 then
response.write "history.go(-1);"
else
response.write "document.location.href='"&url&"';"
end if
response.write "</script>"
response.end
end sub
Rem 过滤SQL非法字符
function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
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
rem 判断EMAIL参数
function IsEmail(email)
dim names, name, i, c
'Check for valid syntax in an email address.
IsEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
IsEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsEmail = 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
IsEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsEmail = false
end if
end function
rem 判断字符串长度
function strLength(str)
ON ERROR RESUME NEXT
dim WINNT_CHINESE
WINNT_CHINESE = (len("天泉网络工作室")=7)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strLength=t
else
strLength=len(str)
end if
if err.number<>0 then err.clear
end function
rem 取字符串
function cutStr(str,strlen)
dim l,t,c
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
cutStr=left(str,i)&"..."
exit for
else
cutStr=str
end if
next
cutStr=replace(cutStr,chr(10),"")
end function
function checknums(byval num1,byval num2)
checknums=false
if num1="" or num2="" then
checknums=false
elseif isnumeric(num1)=false or isnumeric(num2)=false then
checknums=false
elseif num1<=0 then
checknums=false
elseif clng(num1)>clng(num2) then
checknums=false
else
checknums=true
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -