📄 index.asp
字号:
if rs.eof then%>
<tr>
<td height="23" valign="middle"> ·暂时没有新进用户!</td>
</tr>
<%else
while not rs.eof%>
<tr>
<td height="23"> ·<a href=showperson.asp?id=<%=rs("id")%> target="_blank"><font color="#000000"><%=rs("name")%></font></a></td>
</tr>
<%rs.movenext
wend
rs.close
rs.open"select * from person",conn,1,1
if rs.recordcount>5 then%>
<tr>
<td height="23" valign="middle">
<p align="right"> <a href=person.asp?style=new style="text-decoration: none"><font color="#000000">更多新进用户</font></a></td>
</tr><%
end if
end if
rs.close%></TD></TR></TBODY></TABLE>
</TD></TR></TBODY></TABLE>
</td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="table15">
<tr bgcolor="eeeeee">
<td width="100%" height="24" align="left" class=bgtle noWrap>标题(发布者)</td>
</tr>
<%rs.open"select * from question order by id desc",conn,1,1
if rs.eof then%>
<tr bgcolor="eeeeee">
<td height="24" align="left" bgcolor="#FFFFFF">暂时没有问题!</td></tr>
<%else
maxnum=rs.recordcount
rs.pagesize=18
maxpage=rs.pagecount
if request("p")="" then
p=1
else
p=cint(request("p"))
end if
if request("to")="转" then
p=cint(request("page"))
end if
if p>maxpage then
p=maxpage
end if
if p=0 then
p=1
end if
if p<>1 then
rs.move (p-1)*rs.pagesize
end if
for i=1 to rs.pagesize%>
<tr>
<td height="29" align="left"><a href=showquestion.asp?id=<%=rs("id")%> target="_blank">
<font color="#000000"><%=rs("title")%></font></a> (<a href=showperson.asp?name=<%=rs("sender")%>><font color="#000000"><%=rs("sender")%></font></a>)</td>
</tr>
<%rs.movenext
if rs.eof then exit for
next
%>
<tr bgcolor="eeeeee"><form method=post action=index.asp>
<td height="24" bgcolor="#FFFFFF">共<%=maxnum%>个问题,10个问题每页,共<%=maxpage%>页,页次:<%=p%>/<%=maxpage%>
<a href=index.asp?p=1><font color="#000000">首页</font></a>
<a href=index.asp?p=<%=p-1%>><font color="#000000">上页</font></a>
<a href=index.asp?p=<%=p+1%>><font color="#000000">下页</font></a>
<a href=index.asp?p=<%=maxpage%>><font color="#000000">尾页</font></a></td></form>
</tr>
<%end if
rs.close%>
</table>
</td><td width="176" valign="top">
<TABLE class="magBtm12 zhtable" cellSpacing=0 cellPadding=0 width="100%"
border=0 id="table9">
<TBODY>
<TR>
<TD bgcolor="#F4BF20" height="1"></TD></TR>
<TR>
<TD bgcolor="#FBF5C6" height="23"><b> <span style="font-size: 11pt">最新问题</span></b></TD></TR>
<TR>
<TD class=bgcntBor3Yl><%rs.open"select top 8 * from question order by id desc",conn,1,1
if rs.eof then%>
<tr>
<td height="23"> ·暂时没有最新问题</td>
</tr>
<%else
while not rs.eof%>
<tr>
<td height="23"> ·<a href=showquestion.asp?id=<%=rs("id")%> target="_blank"><font color="#000000"><%if len(rs("title"))>10 then%><%=left(rs("title"),10)&"…"%><%else%><%=rs("title")%><%end if%></font></a></td>
</tr>
<%rs.movenext
wend
rs.close
rs.open"select * from question",conn,1,1
if rs.recordcount>5 then%>
<tr>
<td height="23">
<p align="right"> <a href=question.asp?style=new style="text-decoration: none"><font color="#000000">更多最新问题</font></a></td><%end if
end if
rs.close%></tr></TD></TR></TBODY></TABLE>
<TABLE class="magBtm12 zhtable" cellPadding=0 width="100%"
border=0 id="table19" style="border-collapse: collapse">
<TBODY>
<TR>
<TD bgcolor="#F4BF20" height="1"></TD></TR>
<TR>
<TD bgcolor="#FBF5C6" height="23"><b><font style="font-size: 11pt">
用户登录</font></b></TD></TR>
<TR>
<Td>
<%if request("login")="登陆" then
if request("name")="" then
response.write"<script>alert('用户名不能为空!');history.back();</script>"
elseif request("pwd")="" then
response.write"<script>alert('密码不能为空!');history.back();</script>"
else
name=request("name")
pwd=request("pwd")
rs.open"select * from person where name='"&name&"' and pwd='"&pwd&"'",conn,1,1
if rs.eof then
response.write"<script>alert('用户名或密码错误!');history.back();</script>"
else
session("person")=name
%>
<%end if
rs.close
end if
end if%>
<%if session("person")<>"" then%>
<tr><td align="center" valign="top"><font color="#FFFFFF"><input type="button" value="发表问题" onclick="window.navigate('send.asp')"></font>
<font color="#FFFFFF"> <input type="button" value="退出问题" onclick="window.navigate('exit.asp')"></font></td>
</tr><tr><td align="left" valign="top">用户名:<%=session("person")%><%
rs.open"select * from person where name='"&session("person")&"'",conn,1,1%>
<%if rs("qq")<>"" then%><br>用户QQ:<%=rs("qq")%><%end if%>
<%if rs("email")<>"" then%><br>用户Email:<%=rs("email")%><%end if%>
<br>用户积分:<%=rs("jifen")%><br>用户头衔:<%=rs("touxian")%>
<br>用户发表问题数:<%=rs("asknum")%>
<br>用户回复问题数:<%=rs("replynum")%>
<br>用户解决问题数:<%=rs("helpnum")%><%rs.close%>
</td>
<%end if%><%if session("person")="" then%><tr><form method=post action=index.asp><td align="center" valign="top">用户名:
<font color="#FFFFFF">
<input name="name" type="text" id="name" size="12"></font>
<br>密 码:
<font color="#FFFFFF">
<input name="pwd" type="password" id="pwd" size="12">
<input name="login" type="submit" id="login" value="登陆">
<input name="reg" type="button" id="reg" value="注册" onclick="window.navigate('reg.asp');">
</font>
</td></form><%end if%></tr></tr></TD></TR></TBODY></TABLE>
<TABLE class="magBtm12 zhtable" cellSpacing=0 cellPadding=0 width="100%"
border=0 id="table10">
<TBODY>
<TR>
<TD bgcolor="#F4BF20" height="1"></TD></TR>
<TR>
<TD bgcolor="#FBF5C6" height="23"><b><span style="font-size: 11pt"> 最新回复</span></b></TD></TR>
<TR>
<TD class=bgcntBor3Yl><%rs.open"select top 5 * from reply order by id desc",conn,1,1
if rs.eof then%>
<tr>
<td height="23"> ·暂时没有最新回复</td>
</tr>
<%else
while not rs.eof%>
<tr>
<td height="23"> ·<a href=showreply.asp?id=<%=rs("id")%> target="_blank"><font color="#000000">
<%if rs("replytitle")="" then%>
<%=left(rs("replycontent"),10)&"..."%>
<%else%>
<%if len(rs("replytitle"))>10 then%><%=left(rs("replytitle"),10)&"…"%><%else%><%=rs("replytitle")%><%end if%>
<%end if%>
</font>
</td>
</tr>
<%rs.movenext
wend
rs.close
rs.open"select * from reply",conn,1,1
if rs.recordcount>5 then%>
<tr>
<td height="23">
<p align="right"> <a href=reply.asp?style=new style="text-decoration: none"><font color="#000000">更多最新回复</font></a></td>
</tr>
<%end if
end if
rs.close%>
</TD></TR></TBODY></TABLE>
</td>
</tr></table>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -