⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default1.asp

📁 留言簿功能所用的源码,功能比较强大,所用数据库关联比较多
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ language=vbscript %>
<!--#INCLUDE file="config.asp"-->

<%session("list")=1%>
<%
Set rs11=server.createobject("ADODB.RECORDSET")
rs11.open "Select * From option1" ,Conn,3,3

session("useridname")=Request.cookies("ly")("useridname")
session("useridpassword")=Request.cookies("ly")("useridpassword")
session("admin")=Request.cookies("ly")("admin")
if session("showmodal")="" then
	Set rs=server.createobject("ADODB.RECORDSET")
	rs.open "Select modal From option1",Conn,3,3
	if rs("modal")=1 then response.Redirect("default.asp")
	session("showmodal")="1"
end if
del=no
type1=no
del=request("del")
type1=request("type1")
Set rs=server.createobject("ADODB.RECORDSET")
if del="ok" and ((session("admin")=1) or (session("admin")=2)) then
if type1="ok" then 
	dsql="delete From reply where replyid="&request("id")	
	conn.execute(dsql)
	rs.open "Select * from guest where ID = " & request("id"),conn,2,3
	rs("hf")=rs("hf")-1
	Set rs1=Server.CreateObject("ADODB.RecordSet")
	rs1.open "Select * from reply where id="&rs("id")&" order by replyid desc",conn,1,1
	if rs1.eof then rs("lastname")="——" else rs("lastname")=rs1("replyname")
	rs.update
	rs1.close
else
	rs.open "Select * from guest where ID = " & request("ID"),conn,3,3
	dsql="delete from reply where id="&request("id")
	conn.execute(dsql)
	dsql="delete From guest where id="&request("id")
	conn.execute(dsql)
end if
set rs=nothing
set rs1=nothing
response.Redirect "default1.asp"
end if
   text=request("text")
   option1=request("option")
   if option1="" then option1=0
if session("admin")="" then session("admin")=false
if request("jinghua")="1" then jinghua=" and jinghua=1" else jinghua=""
Set rs=server.createobject("ADODB.RECORDSET")
select case option1
case 1
SQL="Select * From guest where subject like '%"&text&"%'"&"'"&jinghua&" order by top1,lastdate desc"
case 2
SQL="Select * From guest where content like '%"&text&"%'"&"'"&jinghua&" order by top1,lastdate desc"
case 4
SQL="Select * From guest where username='"&text&"'"&jinghua&" order by top1,lastdate desc"
case else
sql="SELECT * FROM guest where 1=1"&jinghua&" ORDER BY top1,lastdate DESC"
end select
   rs.open sql,conn,3,3
   if not rs.bof then
	 Set rs1=server.createobject("ADODB.RECORDSET")
     rs1.open "Select * From option1",Conn,3,3
     webname=rs1("webname")
	 homepage=rs1("weblink")
	 rs.pagesize=rs1("row1")
	 rs1.close
	 PageNo=REQUEST("PageNo")
	 if PageNo="" or PageNo=0 then PageNo=1
	 RS.AbsolutePage=PageNo
	 TSum=rs.pagecount
	 RowCount=rs.PageSize
	   PageNo=PageNo+1
	   PageNo=PageNo-1
	 if CINT(PageNo)>1 then
	    if CINT(PageNo)>CINT(TSum) then
		  response.Write("对不起没有您想要的页数")
          Response.End
	    end if
	 end if		    
     if PageNo<0 then
	    response.Write("没有这一页!")
		Response.End
	 End if
	 end if
%>

<link href="1.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if rs11("lytitle")="" then%><title>留言板</title><%else%><title><%=rs11("lytitle")%></title><%end if%>
    <tbody>
	  <tr>
	    
    <td align=center><table border=0 width=100% align=center>
        <tr> 
          <td width="100%" align=center> 
            <!--#INCLUDE file="top.asp"-->        </tr>
        <tr> 
          <td align=center><hr size=1 width=100% noshade color=#C0C0C0></tr>
      </table></td>
	   </tr>
	   <tr>
	     <td>
  	      <table border=0 width=100% align=center>
        <td width="26%" align=lift> <font color=#000000>留言数:</font><font color=#000000><%=rs.RECORDCOUNT%></font> 
            总页数:<font color=#000000><%=TSum%></font>&nbsp; 
          第<%=PageNo%>页 </td>
	       
          <td width="74%" align=right>
            <!--#INCLUDE FILE="link.asp"--></span>          </td>
        </table>
  </tr>
	    <tr><td><HR SIZE=1 WIDTH=100% NOSHADE COLOR=#C0C0C0></td></tr>
        <tr>
		 <td align=left><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="73%"><strong></strong><font color="#FF0000"><a href="<%=homepage%>"><%=webname%>首页</a> 
            &nbsp;</font><a href="default.asp">讨论区方式查看</a> 
            <div align="center"></div></td>
          <td width="27%"> <div align="right"> 
              <% 
if TSum>1 Then
 If PageNo=TSum or PageNo<>1 Then 
   PrwePage=PageNo-1
   Response.Write "<A HREF=default1.asp?Pageno=1"&"&text="&text&"&option="&option1&"&jinghua="&jinghua
   Response.Write ">第一页</A>  "         
   Response.Write "<A HREF=default1.asp?Pageno="&PrwePage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
   Response.Write ">上一页</A>  "              
 End If        
 If pageno=1 or TSum>PageNo Then 
   NextPage=PageNo+1             
   Response.Write "<A HREF=default1.asp?PageNo="&NextPage&"&text="&text&"&option="&option1&"&jinghua="&jinghua
   Response.Write ">下一页</A>  "
   Response.Write "<A HREF=default1.asp?Pageno="&rs.PageCount&"&text="&text&"&option="&option1&"&jinghua="&jinghua
   Response.Write ">最末页</A>  "          
 End If                    
End If          
%>
          </div></td>
        </tr>
      </table>
      <td></tr>
		<tr>
    <td> <div align="right"> </div>
      <div align="center">
      <table width="100%" height="17" border="0" bgcolor="#E6F2FF" style="BORDER-LEFT:1px SOLID #000000;BORDER-RIGHT:1px SOLID #000000;BORDER-TOP:1px SOLID #000000; ; border-collapse:collapse; border-bottom-color:#000000; border-bottom-width:1px">
        <tr> 
          <td width="16%" align="center">作者信息</td>
          <td width="84%" height="17" align="center">
			<p align="left">| 留言信息</td>
        </tr>
      </table>
      </div>
      <%
      if PageNo=1 then i=rs.RECORDCOUNT else i=rs.RECORDCOUNT-(10*(PageNo-1))
      bool=false
	  bg=1
	  %>
      <% DO WHILE NOT rs.EOF AND RowCount>0%>
      <table width="100%" border="0" align=center cellpadding="0" cellspacing="5" <%if bg mod 2=0 then%>bgcolor="#f0f8ff"<%else%>bgcolor="#f8f8f8"<%end if%> style="word-break:break-all;BORDER-LEFT:#0098c8 1PX SOLID;BORDER-RIGHT:#0098c8 1PX SOLID;<% if bool=false then%>BORDER-TOP:#0098c8 1PX SOLID;<%bool=true%><%end if%>BORDER-BOTTOM:#0098c8 1PX SOLID">
        <tr> 
          <td width="17%" rowspan="4" align=center valign="top" style=" BORDER-right:#98ccff 1PX SOLID"> 
            <table width="100%" border="0" align="center" >
              <tr> 
                <td width="90" style=filter:glow(color=#0000FF,strength=2)>
<div align="center"><font color=#F0FFFF> 
                    <%if rs("username")<>"" then%>
                    <%=rs("username")%> 
                    <%else%>
                    ?T??ê? 
                    <%end if%>
                    </font> </div></td>
                <td width="50"> 
                  <%
			  Set rs2=server.createobject("ADODB.RECORDSET")
			  sql2="SELECT * FROM register where username='"&rs("username")&"'"
			  rs2.open sql2,conn,3,3
			  if not rs2.eof then
			if rs2("levels")="管理员" then%>
                  <font color=#000000><img src="images/fbz.gif" alt="管理员" width="16" height="16"></font> 
                  <%end if
			if Instr(rs2("levels"),"版主")>0 then%>
                  <font color=#000000><img src="images/bz.gif" alt="版主" width="16" height="16"></font> 
                  <%end if            
			if rs2("levels")="嘉宾" then%>
                  <font color=#000000><img src="images/gly.gif" alt="嘉宾"></font> 
                  <%end if
			  end if
			%>
                  <%
			  if not rs2.eof then
			  %>
                  <%if rs2("sex")="1" then%>
                  <img src="images/man.gif" alt="GG" width="20" height="14"> 
                  <%end if%>
                  <%if rs2("sex")="0" then%>
                  <img src="images/woman.gif" alt="MM" width="20" height="14"> 
                  <%end if%>
                  <%else%>
                  <%if rs("sex")="1" then%>
                  <img src="images/man.gif" alt="GG" width="20" height="14"> 
                  <%end if%>
                  <%if rs("sex")="0" then%>
                  <img src="images/woman.gif" alt="MM" width="20" height="14"> 
                  <%end if%>
                  <%end if%>
                </td>
              </tr>
            </table>
          <%if not rs2.eof then%>
          <img src="<%=rs2("face")%>"> 
          <%else if rs("face")="" then%>
          <img src="face/1.gif"> 
		  <%else%>
		  <img src="<%=rs("face")%>"> 
		  <%end if%>
          <%end if%>
            <br> 
            <%
			  if not rs2.eof then
			  %>
            头衔:<%=rs2("levels")%><br>
            发言数:<%=rs2("counts")%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -