www.gusucode.com > 艺帆全站DIV+CSS体育用品公司网站源码 1.7.5源码程序 > conn.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%Response.CodePage=65001%> <%Response.Charset="utf-8"%> <!--#include file="path.inc"--> <% response.buffer=true '启用缓冲处理 if pathcfg=1 then Dim templj,aryTemp,newpath templj="" newpath="" If lx=0 Then templj=Request("PATH_INFO") aryTemp = Split(templj,"/") Else templj=Request("PATH_TRANSLATED") aryTemp = Split(templj,"\") End If For i = LBound(aryTemp) To UBound(aryTemp)-1 If lx=0 Then newpath=newpath&aryTemp(i)&"/" Else newpath=newpath&aryTemp(i)&"\" End If Next Readsyspath=replace(mid(newpath,instr(2,templj,"/")),"/","\") webpath=replace(newpath,replace(Readsyspath,"\","/"),"") if Readsyspath="\" then path=Server.MapPath("./")&"\" else path=replace(Server.MapPath("./")&"\",Readsyspath,"") end if path=path+"\OneFCMS_Data\OneFCMS$%#$#Data$%#2012#$11$$#7.mdb" else path=server.mappath("/OneFCMS_Data/OneFCMS$%#$#Data$%#2012#$11$$#7.mdb") end if dim conn dim connstr 'on error resume next connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&path set conn=server.createobject("ADODB.CONNECTION") conn.open connstr If Err Then err.Clear Set Conn = Nothing Response.Write "数据库连接出错,请检查数据库连接文件中的数据库参数设置。" Response.End End If sub Chkhttp() server_vv=len(Request.ServerVariables("SERVER_NAME")) server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv) server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv) if server_v1<>server_v2 or server_v1="" or server_v1="" then response.Charset="utf-8" response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>") response.end end if end sub %>