📄 freeadd.asp
字号:
<%
'检查用户是否已经经过登陆验证了
if session("admin") = "" Then
'如果没有登陆,则输出出错信息
'要求用户进行登陆
response.write "<br><br><br>"
response.write "<table align='center' width='300' border='1' cellpadding='0' cellspacing='0' bordercolor='#999999'>"
response.write "<tr bgcolor='#999999'>"
response.write "<td colspan='2' height='15'>"
response.write "<div align='center'><font color='#FFFFFF'>操作: 确认身份失败!</font></div>"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
response.write "<td colspan='2' height='23'>"
response.write "<div align='center'><br><br>"
response.write "非法登陆,您的操作已经被记录!!! <br><br>"
response.write "<a href='javascript:onclick=history.go(-1)'>返回</a>"
response.write "<br><br></div></td>"
response.write "</tr></table>"
'终止响应
response.end
end If
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添 加 短 消 息</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
'变量定义
dim rs,sql,count
'记录集对象
set rs=server.createobject("adodb.recordset")
'查询所有栏目
sql = "select * from subclass order by id asc"
'执行查询
rs.open sql,conn,1,1
'将所有二级栏目名称和所对应一级栏目信息写入到客户端的脚本语句中
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("subclass"))%>","<%= trim(rs("parentid"))%>","<%= trim(rs("id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<br><br>
<form method="POST" name="myform" action="adminsave.asp?action=add">
<div align="center"><center><table cellspacing="0" width="80%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20"><font color="#FFFFFF"><center><p><b>添 加 短 信</b></font></td>
</tr>
<tr align="center">
<td width="100%">
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="15%" align="right" valign="top" height="20"><b>短信类型:</b></td>
<td width="85%">
<%
'所有一级栏目信息
sql = "select * from class order by id desc"
'执行查询
rs.open sql,conn,1,1
'如果没有一级栏目,则要求先添加栏目
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%> <select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1">
<option selected value="">=选择类别=</option>
<%
'循环显示所有一级栏目信息
do while not rs.eof
%>
<option value="<%=trim(rs("id"))%>"><%=trim(rs("class"))%></option>
<%
rs.movenext
loop
end If
'关闭记录集,释放对象
rs.close
set rs = Nothing
'关闭数据库连接,释放对象
conn.Close
set conn = nothing
%>
</select>
<select name="Nclassid">
<option selected value="">==请选栏目==</option>
</select>
*(请先选择类别,右边会出现二级分类!)</td>
</tr>
<tr>
<td width="15%" align="right" height="30"><b>短信标题和内容:</b></td>
<td width="85%" height="30"><input type="text" name="txttitle" size="70" class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" valign="top"><p> </p>
<p><b><font color="#FF0000">请注意:标题是发送给用户的实际信息。为方便管理建议将标题的内容复制到内容里面,保持一致!</font></b></p></td>
<td width="85%"><textarea rows="15" name="txtcontent" cols="60" class="smallarea"></textarea></td>
</tr>
<tr>
<td width="15%" align="right" height="30"><b>关键字:</b></td>
<td width="85%" height="30"><input type="text" name="key" size="70" class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="30"><b>作者:</b></td>
<td width="85%" height="30"><input type="text" name="writer" size="70" class="smallinput" maxlength="100"></td>
</tr>
<tr>
<td width="15%" align="right" height="30"><b>来源:</b></td>
<td width="85%" height="30"><input type="text" name="writefrom" size="70" class="smallinput" maxlength="100" value="www..com"></td>
</tr>
</table>
</td>
</tr>
</table>
</center></div><div align="center"><center><p>
<input type="submit" value=" 添 加 " name="cmdok" class="buttonface">
<input type="reset" value=" 清 除 " name="cmdcancel" class="buttonface"></p>
</center></div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -