我的原代码为:
<%
m = TRIM( Request( "messageId" ) )
ord=TRIM(Request("ordernum"))
if m="" then
sql="select m_id,m_subject from bbs where m_reply=0 and m_ordernum='"&ord&"'"
Set RS1 = Server.CreateObject( "ADODB.RecordSet" )
RS1.Open sql,cn
while not RS1.EOF
m=RS1("m_id")
RS1.MoveNext
wend
end if
MySQL = "select * from bbs where m_id='"&m&"'"
Set RS = Server.CreateObject( "ADODB.RecordSet" )
RS.Open MySQL, Cn, adOpenStatic
%>
<html>
<head><title>Message</title></head>
<body bgcolor="#FFFFED">
<% while not rs.EOF %>
<table width="780" bgcolor="#c0c0c0" cellspacing=0 cellpadding=2 border=0>
*******
<% if rs("m_reply")=1 then%>
<tr bgcolor="#FFCCCC">
<td colspan=2> <small><b>主题:</b> <i><%=RS( "m_subject" )%></i></small> </td>
</tr>
<% end if %>
**********
<tr bgcolor="#FFCCCC">
<td width="314"><small><b>作者:</b> <i><%=RS( "m_username" )%></i></small></td>
<td width="458"><small><b>Email地址:</b> <i><%=RS("m_email")%></i></small></td>
</tr>
<tr bgcolor="#FFCCCC">
<td colspan=2> <small><b>主题:</b> <i><%=RS( "m_subject" )%></i></small> </td>
</tr>
<tr bgcolor="#FFEBE1">
<td colspan=2>
<pre><%=Server.HTMLEncode( RS("m_message"))%></pre>
</td>
</tr>
</table>
<%
RS.MoveNext
wend
%>