<% 'On Error Resume Next filename=Request.ServerVariables("URL") dbpath="#Date.asp"'数据库连接地址 Set conn=Server.CreateObject("adodb.connection") db="provider = Microsoft.Jet.OLEDB.4.0;Data Source ="&server.mappath(dbpath) conn.open db function HTMLEncode(fString) If not isnull(fString) then fString = replace(fString, ">", ">") fString = replace(fString, "<", "<") fString = Replace(fString, CHR(32), " ") fString = Replace(fString, CHR(9), " ") fString = Replace(fString, CHR(34), """) fString = Replace(fString, CHR(39), "'") fString = Replace(fString, CHR(13), "") fString = Replace(fString, CHR(10) & CHR(10), "

") fString = Replace(fString, CHR(10), "
") HTMLEncode = fString End If End function function UHTMLEncode(fString) If not isnull(fString) then fString = Replace(fString, " ", CHR(32)) fString = Replace(fString, " ", CHR(9)) fString = Replace(fString, """, CHR(34)) fString = Replace(fString, "'", CHR(39)) fString = Replace(fString, "", CHR(13)) fString = Replace(fString, "

", CHR(10) & CHR(10)) fString = Replace(fString, "
", CHR(10)) HTMLEncode2 = fString End If End function function checkadmin() If session("Admin")="" then Response.redirect filename&"?action=login" Response.End End If End function action=Request.Querystring("action") id=Request.Querystring("id") If id<>"" and not isnumeric(id) then Response.Write "" Response.End End If %> 千炮捕鱼电玩城:安惠汽车服务公司-安惠汽车连锁养护中心-汽车保养

千炮捕鱼电玩城

千炮捕鱼电玩城-百人牛牛游戏-手机棋牌网站-手机炸金花

 
<% select case action case "del" checkadmin If id="" then Response.Write "" Response.End End If conn.execute("DELETE FROM [book] WHERE id="&id) Response.Write "" case "add" Name=htmlencode(request.form("Name")) Qq=Request.ServerVariables("remote_addr") Mail=htmlencode(request.form("Mail")) Info=htmlencode(request.form("Info")) If Name="" or Mail="" or Info="" then Response.Write "" ElseIf len(Name)>16 then Response.Write "" ElseIf len(Mail)>30 or len(Mail)<6 then Response.Write "" ElseIf len(Info)>400 then Response.Write "" Else Set omRsadd = Server.CreateObject("adodb.recordSet") omRsadd.open "Select * from book", conn, 1, 3 omRsadd.addnew omRsadd("Name") = Name omRsadd("Mail") = Mail omRsadd("Qq") = Qq omRsadd("Info") = Info omRsadd("time") = now() omRsadd.update omRsadd.close Set omRsadd = nothing Response.Write "" Response.End End If case "Reply" checkadmin Reply=trim(htmlencode(request.form("Reply"))) If id="" then Response.Write "" Response.End End If Name=htmlencode(request.form("Name")) Qq=htmlencode(request.form("Qq")) Mail=htmlencode(request.form("Mail")) Info=htmlencode(request.form("Info")) If Name="" or Mail="" or Info="" then Response.Write "" ElseIf len(Name)>16 then Response.Write "" ElseIf len(Info)>400 then Response.Write "" Else Id=Request("Id") Set mRs=Server.CreateObject("adodb.recordSet") Sql="Select * from Book where Id="&Id mRs.open Sql,conn,1,3 mRs("Name")=Request("Name") mRs("Qq")=Request("Qq") mRs("Mail")=Request("Mail") mRs("Info")=Request("Info") mRs("Reply")=Request("Reply") mRs.update mRs.close Set mRs=nothing Response.Write "" End If Response.Write "" case "modpassed" checkadmin User=htmlencode(request.form("User")) oldpass=md5(request.form("oldpass")) newpass=md5(request.form("newpass")) newpass2=md5(request.form("confirm")) sub Checkpass(password) Set mRs=conn.execute("SELECT * FROM [Admin] WHERE user='"&session("Admin")&"' AND pass='"&password&"'") If mRs.eof then Response.Write "" Response.End End If End sub Checkpass oldpass If newpass="" then Response.Write "" Response.End End If If newpass<>newpass2 then Response.Write "" Response.End End If conn.execute("update [Admin] Set pass='"&newpass&"' WHERE user='"&session("Admin")&"'") session("Admin")=User Response.Write "" response.en case "logout" session.Contents.Remove("Admin") Response.Write "" Response.End case "logincheck" User=htmlencode(request.form("User")) password=md5(request.form("password")) function CheckLogin(User,password) Set mRs=conn.execute("SELECT * FROM [admin] WHERE user='"&User&"' AND pass='"&password&"'") If not mRs.eof then session("admin")=mRs("user") Response.Write "" Response.End Else Response.Write "" Response.End End If End function CheckLogin User,password case "login" %>
 · 管理登陆 ·
管理员:
密  码:
    



<% case "modpass" checkadmin %>
 · 管理员帐号修改 ·
登录名: " size="20" maxlength="16" readonly class="input">
旧密码:
新密码:
确  认:
    



<% case "reply" checkadmin If id="" then Response.Write "" Response.End End If Set mRs=conn.execute("SELECT * FROM [book] WHERE id="&id) If mRs.eof then Response.Write "" Response.End End If Name=mRs("Name") Qq=mRs("Qq") Mail=mRs("Mail") Info=mRs("Info") reply=mRs("reply") %>
 · 回复留言: ·
称呼: ">
邮箱: ">
留言:
回复:
    



<% Set mRs=nothing case Else %>
 · 写留言 ·
称呼:  * 内容:  *
邮箱:  *
   
 · 留言列表 · <% If session("admin")<>"" then Response.Write"  修改帐号 " Response.Write"  退出管理" Else Response.Write"  管理员登录" End If %>
<% sql="select * from [book] order by id desc" Set mRs=Server.CreateObject("adodb.recordSet") mRs.open sql,conn,1,1 If mRs.bof and mRs.eof then Response.Write"没有任何记录" Response.End Else mRs.PageSize =8'每页记录条数 iCount=mRs.RecordCount '记录总数 iPageSize=mRs.PageSize maxpage=mRs.PageCount page=request("page") If Not IsNumeric(page) or page="" then page=1 Else page=cint(page) End If If page<1 then page=1 ElseIf page>maxpage then page=maxpage End If mRs.AbsolutePage=Page If page=maxpage then x=iCount-(maxpage-1)*iPageSize Else x=iPageSize End If End If %> <% i=1 for j=1 to mRs.pagesize %>
2 <% =mRs("Name") %><% =mRs("Time") %>的留言: <% If session("Admin")<>"" then Response.Write" 回复" Response.Write" 删除" Response.Write" IP:"&mRs("Qq")&"" End If %> <% If mRs("Mail")<>"" then Response.Write" +" End If %>
<% if isnull(mRs("reply")) then response.write " 留言成功,请稍后查看回复,谢谢! " else response.write mRs("info") end if %> <% If mRs("reply")<>"" then Response.Write"
回复:
"&mRs("Reply")&"
" End If %>  
<% i=i+1 mRs.movenext If mRs.eof then exit for next %>
<% End select %>
<% call PageControl(iCount,maxpage,page,"border=0 align=center","

") mRs.close Set mRs=nothing Sub PageControl(iCount,pagecount,page,table_style,font_style) '生成上一页下一页链接 Dim query, a, x, temp action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME") query = Split(Request.ServerVariables("QUERY_STRING"), "&") For Each x In query a = Split(x, "=") If StrComp(a(0), "page", vbTextCompare) <> 0 Then temp = temp & a(0) & "=" & a(1) & "&" End If Next Response.Write("" & vbCrLf ) Response.Write("" & vbCrLf ) Response.Write("" & vbCrLf ) Response.Write("
" & vbCrLf ) Response.Write(font_style & vbCrLf ) If page<=1 then Response.Write ("首页 " & vbCrLf) Response.Write ("上一页 " & vbCrLf) Else Response.Write("首页 " & vbCrLf) Response.Write("上一页 " & vbCrLf) End If If page>=pagecount then Response.Write ("下一页 " & vbCrLf) Response.Write ("尾页 " & vbCrLf) Else Response.Write("下一页 " & vbCrLf) Response.Write("尾页 " & vbCrLf) End If Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf) Response.Write(" 共有" & iCount & "条留言" & vbCrLf) Response.Write(" 转到" & "" & "页" & vbCrLf & "") Response.Write("
" & vbCrLf ) End Sub %>