moreview.asp

来自「修正的自由领域投票系统2.0 支持文件上传」· ASP 代码 · 共 149 行

ASP
149
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp"-->
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<% 
if request.QueryString("action")="del" then
call del
else
call main
end if
sub main
id=request.QueryString("id")
id=replace(id,"'","")
id=replace(id,">","")
id=replace(id,"<","")
id=replace(id,"""","")
set rs=conn.execute("select * from stu where id="&id)
dim sname
sname=rs("stuname")
set rs=nothing
dim sql
dim page
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "Select * FROM pinlun where uid='"&id&"' Order By id Desc"
rs.open sql,conn,1,3

IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
Page=Int(Abs(Request("page")))
End if

If not rs.eof then 
rs.pagesize =liuyans
total  = rs.RecordCount
mypagesize=rs.pagesize
rs.absolutepage = page
end if

%>
<title>查看关于<%=sname%>的留言信息</title>
<style type="text/css">
<!--
.STYLE1 {color: #FF3366}
-->
</style>
</head>
<body>
<table width="56%" border="1" cellpadding="0" cellspacing="1" bordercolor="#993300">
  <tr>
    <td width="550"><p class="STYLE1">查看关于<%=sname%>的留言信息</p>
    <table align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DCE5" width="100%">
      <tbody>
        <%
i=1
do while not rs.eof  and mypagesize>0
pid=rs("id")
pname=rs("pname")
shijian=rs("shijian")
content=rs("content")
%>
        <tr>
          <td width="453" height="20" background="images/backg.gif" bgcolor="#f7f7f7"><table border="0" cellpadding="0" cellspacing="0" width="99%">
            <tbody>
              <tr>
                <td valign="bottom" width="50%"><font class="td"> <%=pname%>发表于:<%=shijian%></font> </td>
                <td align="right" width="50%" class="td"><% if session("admin")<>"" then %>
                       <a href="moreview.asp?action=del&pid=<%=pid%>&id=<%=id%>">删除</a>
                    <% end if %></td>
              </tr>
            </tbody>
          </table></td>
        </tr>
        <tr>
          <td bgcolor="#f7f7f7" height="80"><table border="0" cellpadding="0" cellspacing="2" width="96%">
            <tbody>
              <tr>
                <td class="td" style="word-break:break-all"><%=content%></td>
              </tr>
            </tbody>
          </table></td>
        </tr>
        <%
mypagesize=mypagesize-1
i=i+1
rs.movenext
loop
%>
        <tr bgcolor="#99CC99">
          <td height="18" colspan="2" valign="bottom"><div align="center">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <form action="moreview.asp?id=<%=id%>" method="post" name="form2" id="form2">
                <tr>
                  <td height="22" align="right" background="images/backg2.gif"><font class="td"><span class="STYLE1">共<b><%=rs.pagecount%></b>页<b><%=total%></b>条留言 当前第<b><%=page%></b>页 <a href="?page=1&id=<%=id%>" class="td">首页</a>
                            <%if page>1 then%>
                            <a href="?page=<%=page-1%>&id=<%=id%>" class="td">上一页</a>
                            <%else%>
                    上一页
                    <%end if%>
                    <%if page<rs.pagecount   then%>
                    <a href="?page=<%=page+1%>&id=<%=id%>" class="td">下一页</a>
                    <%else%>
                    下一页
                    <%end if%>
                    <a href="?page=<%=rs.pagecount%>&id=<%=id%>" class="td">尾页</a>
                    <select name="page" class="td">
                      <%for i=1 to rs.pagecount%>
                      <option value="<%=i%>"
														  <%
					  if i=page then
					  response.write" selected"
					  end if
					  %>
									><%=i%></option>
                      <%next%>
                    </select>
                  </span></font><font color="#ffffff" class="td">
                  
                    <input type="submit" name="Submit22" value="转向" class="td" />
                  </font></td>
                </tr>
              </form>
            </table>
          </div></td>
        </tr>
      </tbody>
    </table></td>
  </tr>
  <tbody>
  </tbody>
</table>
<% set rs=nothing
set conn=nothing
end sub
sub del
dim id 
id=request.QueryString("id")
set rs=conn.execute("delete * from pinlun where id="&request.QueryString("pid")&"")
set rs=nothing
set conn=nothing
response.Write("<script>window.alert('删除成功!');window.location.href('moreview.asp?id="&id&"')</script>")
response.End()
end sub%>
</body>
</html>

⌨️ 快捷键说明

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