我的网页上传到虚拟主机上经常出现:系统升级中。附上代码,请高手帮忙看看是什么问题。谢谢
我的网页上传到虚拟主机上经常出现:系统升级中。在本机测试是不会出现 系统升级中。请高手帮忙看看是什么问题。谢谢!数据库连接代码如下:
<%
dim conn,connstr
class db_DataBase
Public Function exe(byval esql,e)
if not isobject(conn) then
'On Error Resume Next
Set conn = Server.CreateObject("adodb.Connection")
if conn.state = 0 Then
const SqlLocalName = "glb18\sql2005" '连接IP [ 本地用 (local) 外地用IP ]
const SqlUserName = "sa" '用户名
const SqlPassword = "111111" '用户密码
const SqlDatabaseName = "condatabase" '数据库名
connstr = "Provider=Sqloledb; User ID=" & SqlUsername &"; Password="& SqlPassword &"; Initial Catalog = "& SqlDatabaseName &"; Data Source="& SqlLocalName & ";"
conn.Open connstr
End if
if Err Then Err.Clear : Set conn = Nothing : Response.Write "系统升级中..........." : Response.End()
End if
select case left(e,1)
case 1 : Set exe = Server.createobject("adodb.recordset") : exe.open esql,conn,1,1
case 2 : exe = conn.execute(esql)(0)
case 3 : Set exe = Server.createobject("adodb.recordset") : exe.open esql,conn,1,3
case 4 : conn.execute(esql)
case 5
Set rs = conn.execute(esql)
if not(rs.eof and rs.bof) Then exe = rs.getrows()
rs.close : set rs = nothing
End select
End Function
Public Function close(se)
if isobject(se) Then if se.state <> 0 Then se.close : set se = nothing
End Function
Public Function server_code()
dim server_v1 : server_v1 = Cstr(Request.ServerVariables("HTTP_REFERER"))
dim server_v2 : server_v2 = Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2)) <> server_v2 Then R.http_referer()
End Function
End class
class db_write
Public Function write(byval str)
Response.write str
End Function
Public Function rend(byval str)
Response.write str
Response.End()
End Function
Public Function http_referer()
On Error Resume Next
Response.Redirect Request.ServerVariables("http_referer")
if Err Then Err.Clear : R.backweb()
End Function
Public Function backweb()
Response.Redirect webpath
Response.End()
End Function
Public Function sVar(byval str)
sVar = Request.ServerVariables(str)
End Function
End class
dim db,R
Set R = new db_write
Set db = new db_DataBase
dim userip '# 提取当前访问用户IP
userip = R.sVar("http_x_forwarded_for")
if userip = "" Then userip = R.sVar("remote_addr")
'*******************************************************************************************
'过程名:addDate
'作 用:日期格式
'*******************************************************************************************
Public Function addDate(byval str,byval e)
if isnull(str) or not isDate(str) Then Exit Function
select case e
case 1 : addDate = right("0"& Month(str),2) & "-"& right("0"& day(str),2)
case 2 : addDate = Year(str) &"-" & right("0"& Month(str),2) &"-" & right("0"& day(str),2)
case 3 : addDate = Year(str) &"年"& right("0"& Month(str),2) &"月"& right("0"& day(str),2) &"日"
End select
End Function
'*******************************************************************************************
'过程名:alert
'作 用:提示作用
'*******************************************************************************************
Public Function alert(byval str,byval back) 'Response.Redirect url
dim Temp
Select case back
case -1 : Temp = "window.history.back(-1);"
case "1" : Temp = "window.location.href='"& Request.ServerVariables("http_referer") &"';"
case "2" : Temp = "window.opener=null;window.close();"
case "3" : Temp = "self.location=document.referrer;"
case else : Temp = "window.location.href='"& back &"';"
End Select
Response.write "<script>window.alert('"& str &"');"& Temp &"</script>" : Response.End()
End Function
Public Function req(byval str,byval et)
Select case left(et,1)
case 0 : req = Trim(str)
case 1
req = Trim(Request.form(str))
if req = "" Then req = Trim(Request.querystring(str))
case 2 : req = Trim(Request.form(str))
case 3 : req = Trim(Request.querystring(str))
End Select
if len(et) = 2 or et = 0 Then
if len(req) = 0 or not isnumeric(req) Then req = 0 else req = int(req)
End if
End Function
Public Function money(byval str)
money = str
if len(money) = 0 or not isnumeric(money) Then money = 0
money = formatnumber(money,2,-1,0,0)
End Function
'*******************************************************************************************
'过程名:uncode
'作 用:过滤所有html
'*******************************************************************************************
Public Function uncode(byval word,byval snum)
if isnull(word) Then Exit Function
word = replace(replace(replace(word," "," "),"'","’"),"""","”")
dim Rp
Set Rp = new RegExp
Rp.ignorecase = True
Rp.global = True
Rp.pattern = "<.*?>"
word = Rp.replace(word,"")
Rp.pattern="\r\n\s*"
word = Rp.replace(word,"")
if snum <> 0 Then if len(word) > snum Then word = left(word,snum)+".."
Set Rp = nothing
uncode = replace(word,chr(10),"")
End Function
%>