📄 artedit.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="cook.asp"-->
<!--#include file="info.asp"-->
<!--#include file="function.asp"-->
<script laguage="javascript">
<!--
function form1_onsubmit()
{
if (document.form1.title.value=="")
{
alert("请输入标题!")
document.form1.title.focus()
return false
}
else if(document.form1.source.value=="")
{
alert("请输入来源!")
document.form1.source.focus()
return false
}
else if(document.form1.author.value=="")
{
alert("请输入作者!")
document.form1.author.focus()
return false
}
else if(document.form1.content.value=="")
{
alert("请输入内容!")
document.form1.content.focus()
return false
}
}
-->
</script>
<%
if request.Form("submit")="提交" then
title=trim(request.form("title"))
source=trim(request.form("source"))
author=trim(request.form("author"))
content=trim(request.form("content"))
id=cint(request.form("id"))
if title="" or source="" or author="" or content="" then
response.Write"<script>alert('标题和内容不能为空!');history.go(-1)</script>"
response.End()
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from art where id="&id
rs.open sql,conn,3,3
rs("title")=title
rs("source")=source
rs("author")=author
rs("content")=content
rs.update
response.Write"<script>alert('网志修改成功!');window.location.href('art.asp')</script>"
response.End()
end if
end if
call htmltop()
id=cint(request.QueryString("id"))
if id<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from art where id="&id
rs.open sql,conn,3,3
%>
<table width="700" height="400" border="0" align="center" cellpadding="0" cellspacing="0" class="TdStyle">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF"><br>
<table width="600" border="0" cellpadding="5" cellspacing="1" bgcolor="#C0C0C0">
<form name="form1" action="artedit.asp" method="post" onsubmit="return form1_onsubmit()">
<tr align="center" bgcolor="#E3E3E3">
<td height="30" colspan="2"><B>编 辑 文 章</B></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="25" align="right">标题:</td>
<td width="500"><input name="title" type="text" value="<%=rs("title")%>" size="30"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">来源:</td>
<td><input name="source" type="text" value="<%=rs("source")%>" size="20"> <button onClick="source.value='网络'">网络</button> <button onClick="source.value='本站啦'">本站啦</button></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">作者:</td>
<td><input name="author" type="text" value="<%=rs("author")%>" size="20"> <button onClick="author.value='未知'">未知</button> <button onClick="author.value='是我啦'">是我啦</button></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right">文章内容:</td>
<td><textarea name="content" cols="60" rows="15"><%=covhtml(rs("content"))%></textarea></td>
</tr>
<tr align="center" bgcolor="#E3E3E3">
<td height="30" colspan="2">
<input type="submit" value="提交" name="submit">
<input type="reset" value="取消" name="reset"><input type="hidden" name="id" value="<%=id%>"> </td>
</tr>
</form>
</table>
<br></td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
call htmlend()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -