📄 add_file.asp
字号:
<%
if session("username")="" or session("usertype")="" then
response.Write"<script>"
response.Write"parent.location.href='default.asp';"
response.Write"</script>"
end if
%>
<!--#include file="conn.asp"-->
<%
if request("action")="add" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from net_file order by id desc"
rs.open sql,conn,3,2
rs.addnew
rs("title")=request("title")
rs("path")=request("cover")
rs("toinfo")=request("toinfo")
rs("filetype")=request("filetype")
rs.update
rs.close
response.Write("<script>")
response.Write("alert('添加成功!');")
response.Write("window.location.href='add_file.asp?id="&request("id")&"';")
response.Write("</script>")
response.End()
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加信息</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>
<TR>
<TD style="HEIGHT: 16px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77%"><SPAN class=heading>添加文件</SPAN> </td>
</tr>
</table></TD>
</TR>
<TR>
<TD height=12 colSpan=2><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#CCCCCC" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
<TR>
<TD height="140" colSpan=2 vAlign=top> <div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#DBDBDB"> <table width="100%" border="0" cellspacing="1" cellpadding="0">
<form method="post" name="post" action="add_file.asp?action=add">
<tr>
<td width="15%" height="25" bgcolor="#FFFFFF"> <div align="right">文件名称:</div></td>
<td width="1%" rowspan="2" background="images/gline.gif" bgcolor="#FFFFFF"><img src="images/gline.gif" width="8" height="27"></td>
<td width="84%" bgcolor="#FFFFFF"> <input name="title" type="text" class=input_main id="title" style="width:320px;">
<input name="toinfo" type="hidden" id="toinfo" value="<%=request("id")%>"></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"><div align="right">文件地址:</div></td>
<td bgcolor="#FFFFFF"><input name="cover" type="text" id="cover" class=input_main style="width:250px;">
<input type="button" name="Submit2" value="上传文件" class="sub" onClick="window.open('upfile.asp','','status=no,scrollbars=no,top=160,left=250,width=420,height=120')"></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF">文件类型:</td>
<td background="images/gline.gif" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><input name="filetype" type="text" id="filetype" class="sub" readonly></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF"> </td>
<td background="images/gline.gif" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="提 交" class=sub onClick="return subclick();">
<input type="reset" name="reset" value="重 置" class=sub>
</td>
</tr>
</form>
</table></td>
</tr>
</table>
</div></TD>
</TR>
</TABLE>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function subclick()
{
if (post.title.value =="")
{
alert("标题不能为空!");
post.title.focus();
return (false);
}
if (post.cover.value =="")
{
alert("文件地址不能为空!");
post.cover.focus();
return (false);
}
if (post.filetype.value =="")
{
alert("文件类型不能为空!");
post.filetype.focus();
return (false);
}
}
//-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -