📄 artadd.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="cook.asp"-->
<!--#include file="info.asp"-->
<script laguage="javascript">
<!--
function form1_onsubmit()
{
if (document.form1.title.value=="")
{
alert("请输入标题!")
document.form1.title.focus()
return false
}
else if(document.form1.content.value=="")
{
alert("请输入文章内容!")
document.form1.content.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
}
}
-->
</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"))
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"
rs.open sql,conn,3,3
rs.addnew
rs("title")=title
rs("source")=source
rs("author")=author
rs("content")=content
rs("tjtime")=date()
rs.update
response.Write"<script>alert('网志添加成功!');window.location.href('art.asp')</script>"
response.End()
end if
end if
call htmltop()
%>
<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="artadd.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 type="text" name="title" size="30">
时间:<font color="#FF0000"><%=date()%></font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="right">来源:</td>
<td><input type="text" name="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 type="text" name="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"></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">
</td>
</tr>
</form>
</table><br></td>
</tr>
</table>
<%
call htmlend()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -