asp如何获取新闻ID

2024-12-25 13:51:25
推荐回答(4个)
回答1:

另外新建一个页面,显示新闻
代码如下:
<%
Dim id
id = trim(request.querystring("ID"))
If id = "" or id = "0" then
response.write("")
response.end
else
set rs= server.createobject("adodb.recordset")
sql = "select * from news where id=" & id
rs.open sql,conn,1,1
%>

<%=rs("content")%>

<%
rs.close
set rs=nothing
conn.close
set conn = nothing
end if%>

回答2:

另外一个页面
<%id=request.QueryString("id")%>

回答3:

<%set rs=conn.execute("select * from news where news_id="&request("news_id")&"")%> <%=rs("content")%>

回答4:

<%
id = request.querystring("id")
%>