ASP生成静态页模板代码(6)
将以下代码保存为:template.asp
<!--#include file="conn.asp" -->
<!--#include file="seeion.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>修改模板</title>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
color: #000000;
margin:0px auto;
line-height:25px;
}
.table {
margin-top:80px;
border:1px #e6e6e6 solid;
}
.title {
line-height:30px;
text-align:left;
padding-left:20px;
font-size:16px;
background:#FAFAFA;
}
-->
</style>
</head>
<body>
<%
dim action,add,moban
action=request("action")
moban=request("moban")
if action="add" then
dim rs2,sql2
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from template"
rs2.open sql2,conn,1,3
rs2("moban")=moban
rs2.update
rs2.close
set rs2=nothing
'response.Redirect("template.asp")
Response.Write "<script>alert('修改成功!');window.location.href='template.asp';</script>"
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from template"
rs.open sql,conn,1,1
%>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="table">
<form action="template.asp?action=add" method="post">
<tr>
<td class="title">编辑模板</td>
</tr>
<tr>
<td class="title"><textarea name="moban" cols="100" rows="30" id="moban"><%=rs("moban")%></textarea></td>
</tr>
<tr>
<td class="title"><input type="submit" name="Submit" value="提交" /> </td>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
%>
</body>
</html>
最新评论
强大!
The purchases I make...
At last! Somonee who...
Good job mkanig it a...
How neat! Is it real...
Unparalleled accurac...
Thanky Thanky for al...
That's an inenguios ...
Holy szhinit, this i...
If you wrote an atri...