www.gusucode.com > 掌柜网店购物系统 4.0码程序 > conn/webconfig.asp

    <%dim da,daurl,xiao1,xiao2,xiao3,xiao4,xiao5,xiao6,xiao7,xiao8,xiao9,xiao10,xiao1url,xiao2url,xiao3url,xiao4url,xiao5url,xiao6url,xiao7url,xiao8url,xiao9url,xiao10url,piao1,piao2,piao3,piao1url,piao2url,piao3url
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from ad",conn,1,1
da=trim(rs("top"))
daurl=trim(rs("topurl"))
xiao1=trim(rs("left1"))
xiao1url=trim(rs("left1url"))
xiao2=trim(rs("left2"))
xiao2url=trim(rs("left2url"))
xiao3=trim(rs("left3"))
xiao3url=trim(rs("left3url"))
xiao4=trim(rs("zuo1"))
xiao4url=trim(rs("zuo1url"))
xiao5=trim(rs("zuo2"))
xiao5url=trim(rs("zuo2url"))
xiao6=trim(rs("zuo3"))
xiao6url=trim(rs("zuo3url"))
xiao7=trim(rs("zuo4"))
xiao7url=trim(rs("zuo4url"))
xiao8=trim(rs("right1"))
xiao8url=trim(rs("right1url"))
xiao9=trim(rs("right2"))
xiao9url=trim(rs("right2url"))
xiao10=trim(rs("right3"))
xiao10url=trim(rs("right3url"))
piao1=trim(rs("middle"))
piao1url=trim(rs("middleurl"))
piao2=trim(rs("bottom"))
piao2url=trim(rs("bottomurl"))
piao3=trim(rs("bigpic"))
piao3url=trim(rs("bigpicurl"))
rs.close
set rs=nothing

dim webname,webemail,dizhi,youbian,dianhua,copyright,webbanner,weblogo,weburl,gonggao,QQ
set rs=server.CreateObject("adodb.recordset")
rs.Open "select webname,webemail,dizhi,youbian,dianhua,copyright,gonggao,weblogo,weburl,webbanner,QQ from shop_config",conn,1,1
webname=trim(rs("webname"))
webemail=trim(rs("webemail"))
dizhi=trim(rs("dizhi"))
youbian=trim(rs("youbian"))
dianhua=trim(rs("dianhua"))
copyright=trim(rs("copyright"))
weblogo=trim(rs("weblogo"))
webbanner=trim(rs("webbanner"))
weburl=trim(rs("weburl"))
gonggao=trim(rs("gonggao"))
QQ=trim(rs("QQ"))
rs.Close
set rs=nothing

Rem 过滤HTML代码
function HTMLEncode(fString)
if not isnull(fString) then
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")

    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#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
else
   HTMLEncode=fstring
end if
end function

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
%>