downinfoadd.asp
来自「ASP编写的一个公司网站的源程序」· ASP 代码 · 共 144 行
ASP
144 行
<%@ Language=VBScript %>
<%
Response.Buffer = True
%>
<!--#include virtual="/Include/Const.asp"-->
<!--#include virtual="/Include/IncSelectConst.asp"-->
<!--#include virtual="/Include/DBConn.asp"-->
<!--#include virtual="/Include/ChkSession.asp"-->
<!--#include virtual="/Include/FuncPub.asp"-->
<!--#include file="Function.asp"-->
<html>
<head>
<title>EditUsers</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content=" ">
<meta name="keywords" content=" ">
<link rel="stylesheet" href="../Css/css.css" type="text/css">
<script language="Javascript" src="/JS/CheckInput.js"></script>
</head>
<script language="javascript">
function formCheck() {
if (document.frmUsers.Type_ID.value=="") {
alert("请选择类别");
document.frmUsers.Type_ID.focus();
return false;
}
if (document.frmUsers.down_title.value=="") {
alert("请填写下载标题");
document.frmUsers.down_title.focus();
return false;
}
if (document.frmUsers.down_path2.value=="") {
alert("请输入上传文件路径");
document.frmUsers.down_path2.focus();
return false;
}
return true;
}
</script>
<!--#include file="Menu.asp"-->
<!------------------------->
<!--修改Users<-->
<!--注意事项<-->
<!-- 以下内容由程序自动生成 -->
<%
IF Request.Form<>"" then
Dim rs,StrSQL
Dim Type_ID,down_title,down_path1,down_path2,down_path,down_content,state,down_ID
Type_ID = ModifyInput(trim(Request.Form("Type_ID")))
down_title = ModifyInput(trim(Request.Form("down_title")))
down_path1 = ModifyInput(trim(Request.Form("down_path1")))
down_path2 = ModifyInput(trim(Request.Form("down_path2")))
down_path = down_path2
down_content = ModifyInput(Request.Form("down_content"))
state = ModifyInput(Request.Form("state"))
'On Error Resume Next
Set rs = Server.CreateObject("Adodb.Recordset")
CheckInput
rs.CursorLocation=3
StrSQL = "Select * From DownInfo Where down_ID=0"
rs.Open StrSQL,conn,1,3
rs.AddNew
rs("Type_ID") = Type_ID
rs("down_title") = down_title
rs("down_path") = down_path
rs("down_content") = down_content
rs("state") = state
rs.Update
down_ID = rs("down_ID")
rs.Close
Conn.Execute "Update DownInfo Set Orderline="&down_ID&" where down_ID="&down_ID&""
If Err.number<>0 then
Call MsgBack("数据库操作错误!","4")
Else
Response.Redirect "DownInfoManage.asp"
End IF
Set rs = Nothing
Sub CheckInput
StrSQL="select count(*) as cou from DownInfo where Type_ID="&Type_ID&" and down_title='"&down_title&"'"
Rs.open StrSQL,conn,1,3
If Rs("cou")<>0 then
Rs.close
Call MsgBack("下载标题重复!","4")
exit Sub
End If
Rs.Close
End Sub
End IF
%>
<form name="frmUsers" method="POST" action="DownInfoAdd.asp" ID="Form1" onsubmit="return formCheck()">
<table border=0 cellspacing=1 cellpadding=2 class=list width=98% ID="Table1">
<tr class=header><td colspan=2>添加下载文件</td></tr>
<tr>
<td class=list>类别:</td>
<td class=list>
<SELECT ID="Select1" NAME="Type_ID">
<option value="">---请选择下载类别---</option>
<%Call DispdownTypeSel(0,"")%>
</SELECT><font color=red>*</font></td>
</tr>
<tr>
<td class=list>下载标题:</td>
<td class=list><input type="text" name="down_title" maxlength=60 size="40" ID="Text1"><font color=red>*</font></td>
</tr>
<tr>
<td class=list>上传文件路径:</td>
<td class=list><input type="text" name="down_path1" maxlength=20 size="14" ID="Text2" value="<%=UPLOAD_FILESPATH%>" readonly style="color:gray"><input type="text" name="down_path2" maxlength=50 size="24" ID="Text3">(此路径为ftp的上传路径)<font color=red>*</font></td>
</tr>
<tr>
<td class=list>下载说明:</td>
<td class=list>
<textarea cols="50" rows="8" name="down_content" ID="Textarea1"></textarea></td>
</tr>
<tr>
<td class=list>是否开放:</td>
<td class=list>是
<input value=1 name=state type=radio ID="Radio2" checked>
否
<input id="Radio7" value=0 name=state type=radio></td>
</tr>
</table>
<p><input type="submit" value="提交" name="btnSubmit" ID=Submit> <input type="reset" value="重写" name="B2" ID=Reset1>
<input type=button name=back value="返回" onclick="window.history.go(-1);" ID="Button1">
</p>
</form>
<!------------------------->
</body>
</html>
<!--#include virtual="/Include/DBClose.asp"-->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?