用Dreamweaver和ACCESS开发制作新闻发布系统
这节可以讲解xh_add.asp就是登陆后台的主页面
下图是后台效果
screen.width-333) {this.width=screen.width-333;this.title='open new window';}" border=0 ;>
然后咱们来看看代码
screen.width-333) {this.width=screen.width-333;this.title='open new window';}" border=0 ;>
这段代码看着是不是很熟悉啊,对了,在上节课我已经详细讲解了这个会话的功能了!
screen.width-333) {this.width=screen.width-333;this.title='open new window';}" border=0 ;>
大家看看这个代码,就是用SQL搜索了,erennew所有的记录,然后用execute执行了这个SQL,关于输入各个数据,由于我没有界图,所以就用代码说明了啊!
<%do while not rs.eof%>
<tr>
<td align="center"><%=rs("id")%></td>
<td><a href=../xh_look.asp?id=<%=rs("id")%> target="_blank"><%=rs("title")%></a></td>
<td><%=rs("xhtime")%></td>
<td align="center"><a href="xh_edit.asp?id=<%=rs("id")%>">编辑</a></td>
<td align="center"><a href="xh_del.asp?id=<%=rs("id")%>">删除</a></td>
</tr>
<%
rs.movenext
loop
%>
大家看这段代码,难点就是编辑和删除的连接为:
xh_edit.asp?id=<%=rs("id")%>"就拿这个讲解吧!
意思就是传递到edit.asp这个页面一个参数,这个在edit.asp页面用querystring来探测这个参数,为什么这么说呢,主要就是为了分别到底是那个那个新闻需要被编辑或者删除,毕竟ID是唯一的!

