变量到另一页不能附值
mqgds 2010-07-10 11:41:55 index.asp页为
<%
dim buyrs,buysql
set buyrs=server.createobject("adodb.recordset")
buysql="select * from Announce"
buyrs.open buysql,conn,1,1
accid=buyrs("announceid")
do while not buyrs.eof
%>
<a href="announce.asp?annid=<%=buyrs("announceid")%>"><%=buyrs("Content")%><%=buyrs("UpdateTime")%><br /></a>
<%
buyrs.moveNext
loop
buyrs.close
set buyrs=nothing
%>
annid通过URL传递给announce页
announce.asp页为
<%
actionid=trim(request(annid))
if actionid = "" or not IsNumeric(actionid) then
response.write "非法提交数据"
else
%>
<%
Dim rscontent,sqlcontent
set rscontent = server.CreateObject("Adodb.Recordset")
sqlcontent = "select * from Announce where AnnounceID = "&actionid
rscontent.open sqlcontent,conn,1,1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=rscontent("content")%></td>
</tr>
</table>
<%end if%>
到了这一页,始终就显示"非法提交数据",annid根本就没被附值!
这样如何处理啊