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

📄 show.asp

📁 在线考试系统的设计与实现
💻 ASP
字号:
<html>
<head>
<title>显示主题及回复</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>
<Script language="VBScript">
<!--
Sub datacheck()
dim username,content
username=trim(reply.username.value)
If username= Empty Then
     MsgBox "「用户名」不得为空白!", 64, "Oh no!"
     reply.username.focus
     Exit Sub
End if

If reply.password.value = Empty Then
     MsgBox "「密码」不得为空白!", 64, "Oh no!"
     reply.password.focus
     Exit Sub
End if
content=trim(reply.content.value)
If content= Empty Then
     MsgBox "「文章内容」不得为空白!", 64, "Oh no!"
     reply.content.focus
     Exit Sub
End if

reply.Submit
End Sub
-->
</Script>
<script language="Javascript">
<!--
var doPopUpX = (screen.width/2)-200;
var doPopUpY = (screen.height/2)-200;
var pos = "left="+doPopUpX+",top="+doPopUpY;
function doPopUp(url){
doPopUpWindow = window.open(url,"用户信息","width=400,height=300,"+pos);
}
-->
</script>
<BODY vLink=#333333 aLink=#333333 link=#333333 bgColor=#ffffff leftMargin=0 
topMargin=0><LINK href="forum.css" type=text/css 
rel=stylesheet>
<%dim name,password
name=session("loginname")
password=session("password")%>
<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center bgColor=#0099cc border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=4 width="100%" 
      border=0>
        <TBODY>
        <TR bgColor=#99ccff>
          <td width="27%" height="2"><font color="#FF0000">&gt;&gt;</font>欢迎您!<b>
            <%if session("loginname")="" then %>
            请先登录!
            <%end if%>
            <%=session("loginname")%></b></td>
          <td height="2" width="62%"><img src="images/reg.gif" width="16" height="16" align="absmiddle"><a href="reg.asp">用户注册</a>|<img src="images/pmlogin.gif" width="16" height="16" align="absmiddle"><a href="login.asp">用户登录</a>|<img src="images/update.gif" width="16" height="16"><a href="usermodify.asp">修改资料</a>|<img src="images/message.gif" width="21" height="14">现在时间:<%=now()%></td>
    <td width="11%" height="2"><img src="images/home.gif" width="14" height="14" align="absmiddle">返回首页</td>
  </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<!--#include file="db.inc"-->
<%artid=request.querystring("titleid")
conn.execute "update list set lookcnt=lookcnt+1 where articleid='"&artid&"'"
set rs=server.createobject("ADODB.recordset")
set userrs=server.createobject("ADODB.recordset")
set listrs=server.createobject("ADODB.recordset")
rs.open "select * from article where articleid='"&artid&"'",conn,1
listrs.open "select * from list where articleid='"&artid&"'",conn,1
%>
<!--#include file="showbody.asp"-->
<table width="95%" border="0" align="center">
  <tr>
    <td height="28"><a href="postnew.asp"><img src="images/post.gif" width="99" height="25" border="0" alt="发表新主题!!!"></a><a href="allreply.asp?titleid=<%=artid%>"><img src="images/reply.gif" width="99" height="25" border="0" alt="我要回复了!!!"></a></td>
    <td height="28"> 
      <div align="right">你是本贴的第<b><%=listrs("lookcnt")%></b>位阅读者
        <%listrs.close%>
        <%set listrs=nothing%>
      </div>
    </td>
  </tr>
</table>
<table width="95%" border="0" align="center" bgcolor="#0099cc" cellpadding="0" cellspacing="0" height="23">
<tr bgcolor="#99ccff"> 
<td  height="23" bgcolor="#99ccff"><b>* 贴子主题:</b><%dim title%><%title=rs("title")%><%=rs("title")%></td></tr>
</table>
<table width="95%" border="0" align="center" bgcolor="#0099cc" cellspacing="1">
<%Rs.Pagesize =5%>
<%
Pageno = CLng(Request("page")) '取得用page信息,并处理
If Pageno < 1 Then Pageno = 1
If Pageno > Rs.PageCount Then Pageno = Rs.PageCount
If pageNo = "" Then Pageno = 1
%>
<%
Sub Showpage(Rs,pageno) '接受参数,显示记录
Rs.AbsolutePage = Pageno
for I =1 To Rs.PageSize
%>
  <tr> 
    <%userrs.open "select * from user where username='"&rs("author")&"'",conn,1%>
    <td width="139" valign="top" bgcolor="#f2f8ff"> 
      <table width="95%" border="0" align="right" height="100%" cellpadding="0" cellspacing="1">
        <tr>
          <td><b><a href=javascript:doPopUp("userinfo.asp?name=<%=userrs("username")%>")><%=userrs("username")%></a></b><br>
            <img src="images/<%=userrs("face")%>.BMP"><br>
            性别:<%=userrs("sex")%> <br>
        来自:<%=userrs("address")%> <br>
        发贴数:<%=userrs("artnum")%><br>
            回复数:<%=userrs("reply")%><br>
            注册时间:<%=userrs("regtime")%><br></td>
        </tr>
      </table>
    </td>
    <td width="79%" bgcolor="#e8f4ff"><img src="images/<%=rs("faceid")%>.gif" width="15" height="15" align="absmiddle"><%=rs("title")%> 
      <hr width="95%" color=#777777 size=1 align="left">
      <table width="97%" border="0" align="center">
        <tr>
          <td><%=rs("content")%></td>
        </tr>
      </table>
      <div align="right">发帖时间:<%=rs("posttime")%> <a href=javascript:doPopUp("userinfo.asp?name=<%=userrs("username")%>")><img src="images/mailbox.gif" width="15" height="15" border=0>信息</a> 
        <a href="mailto:<%=userrs("email")%>"><img src="images/noan.gif" width="16" height="16" border="0" alt="<%=userrs("email")%>">Email</a>
        <img src="images/ip.gif" width="13" height="15" alt="<%=userrs("ip")%>">IP 
        <img src="images/oicq.gif" width="16" height="16" alt="<%=userrs("oicq")%>"><%userrs.close%>QQ<br>
      </div>
      <hr width="95%" color=#777777 size=1 align="right">
    </td>
  </tr>
<%
Rs.Movenext
If Rs.Eof Then Exit For
Next
end sub
%>
<% showpage rs,pageno %>
</table>
<br>
<!--显示分页链接-->
<table width="95%" align=center border=0 cellpadding=0 cellspacing=0><tr>
<td><div align="right">位置<%=pageno%>/<%=rs.pagecount%>&nbsp;
<%
If Pageno <>1 Then
	Response.Write "&nbsp;<A href="&request.ServerVariables("script_name")&"?titleid="&artid&"&page=1>第一页</A>&nbsp;"
	Response.Write "&nbsp;<A href="&request.ServerVariables("script_name")&"?titleid="&artid&"&page=" & (Pageno-1) & ">上一页</A>&nbsp;"
Else
	Response.Write "&nbsp;第一页&nbsp;"
	Response.Write "&nbsp;上一页&nbsp;"
End If
If Pageno <> rs.PageCount Then
	Response.Write "&nbsp;<A href="&request.ServerVariables("script_name")&"?titleid="&artid&"&page=" & (Pageno+1) & ">下一页</A>&nbsp;"
	Response.Write "&nbsp;<A href="&request.ServerVariables("script_name")&"?titleid="&artid&"&page=" & (Rs.PageCount) & ">最后一页</A>&nbsp;"
Else
	Response.Write "&nbsp;下一页&nbsp;"
	Response.Write "&nbsp;最后一页&nbsp;&nbsp;"
End If
%></div></td></tr></table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td bgcolor="#99ccff" height="23"><b>* 快速回复:</b><%=title%></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellspacing="1" bgcolor="#0099cc">
  <form name="reply" method="post" action="reply.asp">
    <tr bgcolor="#f2f8ff"> 
      <td width="199" bgcolor="#f2f8ff">你的信息</td>
      <td width="549"> 你的用户名: 
        <input type="text" name="username" class=input value="<%=name%>">
        你的密码: 
        <input type="password" name="password" class=input value="<%=password%>">
      </td>
    </tr>
    <tr bgcolor="#ffffff"> 
      <td width="199" height="24">回复主题</td>
      <td width="549" height="24"> 
        <input type="text" name="title" size="60">(可选)
      </td>
    </tr>
    <tr bgcolor="#ffffff"> 
      <td width="199" height="24">回复内容</td>
      <td width="549" height="24"> 
        <textarea name="content" cols="80" rows="5"></textarea>
      </td>
    </tr>
    <tr> 
      <td colspan="2" height="24" bgcolor="#f2f8ff"> 
        <div align="center">
          <input type="button" value="提交" onclick="datacheck">
          <input type="hidden" name="titleid" value="<%=artid%>">
          <input type="reset" value="重写">
        </div>
      </td>
    </tr>
  </form>
</table>
<!--#include file="footer.asp"-->
</body>
</html>

⌨️ 快捷键说明

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