|
蓝森林 http://www.lslnet.com 2006年8月25日 8:28
(asp)新闻系统的问题,请高手指教(我在线等)
:)我写的是简单的新闻发布系统: 修改页面的问题~~~~xiugai.asp 获取的是xiugai2.asp的
id 然后我想把xiugai.asp(修改过的内容)在提交在xiugai2.asp中去~~
我是新手,请大家多多帮助~~我在线等
xiugai.asp
<!--#include file="conn.asp"-->
<html>
<head>
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: 12px}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
修改页面
<form name="form1" method="post">
<%
dim title,content,id
title=request("title")
content=request("content")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from article1",conn,1,3
page=request("page")
rs.pagesize=4
if page="" then page=1
page=cint(page)
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.absolutepage=page
for i=1 to 4
if rs.eof then exit for
%>
<table width="600" border="1" align="center">
<tr>
<td width="160"><span class="style1">标题</span>:
<input name="title" type="text" size="15" value="<%=rs("title")%>"></td>
<td width="293"><textarea name="content" cols="40" rows="6"><%=rs("content")%></textarea></td>
<td width="125"><div align="center">
<p class="style1"><a href="admin_article.asp">添加</a></p>
<p class="style1"><a href="xiugai2.asp?id=<%=rs("id")%>">修改</a></p>
<p class="style1"><a href="shanchu1.asp">删除</a></p>
</div></td>
</tr>
<%
rs.movenext
next
%>
<tr>
<td colspan="3">第<%=page%>页 <a href="?page=<%=page-1%>">上一页</a> <a href="?page=<%=page+1%>">下一页</a> 共<%=rs.pagecount%>页
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
%>
</form>
</body>
</html>
xiugai2.asp
<!--#include file="conn.asp"-->
<html>
<head>
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="xiugai.asp">
<table width="600" border="1" align="center">
<%
id=request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from article1 where id=" & id,conn,1,3
%>
<tr>
<td width="160"><span class="style1">标题</span>:
<input name="title" type="text" size="15" value="<%=rs("title")%>"></td>
<td width="293"><textarea name="content" cols="40" rows="6"><%=rs("content")%></textarea></td>
<td width="125"><div align="center">
<p class="style1"><a href="admin_article.asp">添加</a></p>
<p class="style1"><a href="xiugai2.asp?id=<%=rs("id")%>">修改</a></p>
<p class="style1"><a href="shanchu1.asp">删除</a></p>
</div></td>
</tr>
<%
rs.update
rs.close
set rs=nothing
%>
<tr>
<td colspan="3">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
</table>
</form>
</body>
</html>
|
修改可以加上 onclick="document.form1.submit();" 链接就不要了。
或 <a href="javascript:location='xiugai2.asp?id=<%=id%>&content='+document.form1.content.value">
试试。。在下没试验。`` |
|