📄 edit.asp
字号:
<%
if session("longin")<>1 then '判断是否登录
response.Redirect("login.asp") '转移到登录页面
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<title>后台管理——修改资料</title>
</head>
<script language="javascript">
<!--
//
function submitcheck()
{
if(form1.filename.value == "")
{ window.alert ("请填写设计标题!");
form1.filename.focus();
return false;
}
if(form1.content.value == "")
{ window.alert ("请填写设计简介!");
form1.content.focus();
return false;
}
}
-->
</script>
<%
function checked(req,reqvalue) 'req和reqvalue是要比较的两个参数
if req=reqvalue then '如果两个参数形同就在HTML中显示checked
checked=" checked"
else
checked=""
end if
end function
%>
<%
action=request("action") '获取操作命令
id=request("id") '获取操作纪录ID号
%>
<!--以下为数据处理操作-->
<%if action="modifypost" then%>
<%
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from design where id="&id
rs.open sql,conn,3,3
rs("filename")=Server.Htmlencode(Request("filename"))
rs("typeid")=Server.Htmlencode(Request("typeid"))
rs("url")=Server.Htmlencode(Request("url"))
rs("pic")=Server.Htmlencode(Request("pic"))
rs("piclink")=Server.Htmlencode(Request("piclink"))
rs("content")=Server.Htmlencode(Request("content"))
rs.update
rs.close
set rs=nothing
set conn=nothing
Response.Redirect "show.asp" '转移到显示已增加的信息的页面
else
Set rs = conn.Execute("select *from design where id="& cint(id)) '读出ID号纪录内容
%>
<table width="600" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<form action="edit.asp?action=modifypost&id=<%=id%>" method="post" name="form1" onsubmit="return submitcheck()" >
<tr bgcolor="#f1f1f1">
<td colspan="2">修改产品/作品信息</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>设计标题:</td>
<td> <input type="text" name="filename" size="19" value="<%=rs("filename")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>相关网址:</td>
<td> <input type="text" name="url" size="19" value="<%=rs("url")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>小图地址:</td>
<td> <input type="text" name="pic" size="19" value="<%=rs("pic")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>大图或者图片连接地址:</td>
<td> <input type="text" name="piclink" size="19" value="<%=rs("piclink")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>设计简介:</td>
<td> <textarea rows="4" name="content" cols="50"><%=rs("content")%></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>设计类型:</td>
<td>
<% '显示现有设计类型和并选中记录的设计类型
Set rs1 = conn.Execute("select * from designtype order by typeid")
%>
<%
do while not rs1.eof
%>
<input name="typeid" type="radio" value="<%=rs1("typeid")%>" <%=checked(rs("typeid"),rs1("typeid"))%>><%=rs1("typename")%>
<%
rs1.movenext
loop
rs1.close
%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td> <input name="submit2" type="submit" value="提交"></td>
</tr>
</form>
</table>
<%rs.close
conn.close
set rs=nothing
set conn=nothing
end if%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -