📄 add_site.asp
字号:
<!--#include file="config.asp" -->
<%
city=trim(request.form("city"))
name=trim(request.form("name"))
url=trim(request.form("url"))
logo=trim(request.form("logo"))
about=trim(request.form("about"))
zhanzhang=trim(request.form("zhanzhang"))
set rs=server.CreateObject("adodb.recordset")
if len(name)>0 then
rs.open"select * from site where 站名='" &name& "' or 网址='" & url &"'",conn,1,1
if not rs.eof then
response.write "<div align=center><a href='javascript:history.back(1)'>该网站已存在,请重新输入!</a></div>"
response.end
end if
rs.close
rs.open "select * from site",conn,3,3
rs.addnew
rs("站名")=name
rs("城市")=city
rs("网址")=url
rs("简介")=about
rs("logo")=logo
rs("站长")=zhanzhang
rs("审核")=0 '0未审核,-1已审核
rs("日期")=date()
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=site"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=keywords content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<title><%=sitename%>- 添加网站</title>
<link href="style.css" rel="stylesheet" type="text/css">
<!--#include file="check.asp" -->
<script language="VBScript">
<!--
''=======================================================''
''函数作用:检测添加网站时的信息是否符合要求
''=======================================================''
function checkaddsite()
if add_site.city.value="0" then
msgbox"请选择城市!"
add_site.city.focus
elseif add_site.name.value="" then
msgbox"请输入网站名称!"
add_site.name.focus
elseif getStrLen(add_site.name.value)>10 then
msgbox"请输入网站名称!(5汉字内或10个字母)"
add_site.name.focus
elseif add_site.url.value="" or add_site.url.value="http://" then
msgbox"请输入网址!"
add_site.url.focus
elseif len(add_site.url.value)>100 then
msgbox"网址太长!(100个字符内)"
add_site.url.focus
elseif getStrLen(add_site.about.value)>40 then
msgbox"请输入文字介绍!(20汉字内)"
add_site.about.focus
elseif getStrLen(add_site.zhanzhang.value)>80 then
msgbox"站长资料太长!(40汉字内)"
add_site.zhanzhang.focus
else
add_site.submit
end if
end function
-->
</script>
</head>
<body leftmargin="0" topmargin="2">
<div align="<%=sitealign%>">
<!--#include file="title.asp" -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760" height="80">
<tr>
<td class=t1 bgcolor="#88CCFF" align="center" width="300"> </td>
<td class=t1 bgcolor="#88CCFF" align="right">添加网站 </td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border:1px solid #88ccff; border-collapse: collapse" width="760">
<tr>
<td width="200" bgcolor="#88ccff" valign="top" align="center"><!--#include file="add_left.asp" --></td>
<td width="560" valign="top">
<!--表单开始-->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="560">
<form method="POST" action="add_site.asp" name="add_site"> <tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">所在城市:</td>
<td width="480" bgcolor="#EBF4FA">
<select name="city">
<option value='0'>请选择城市</option>
<%set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from city where 审核=-1 order by 省份,人气 desc",conn,1,1
while not rs1.eof
response.write"<option value='"&rs1("区号")&"'>" &rs1("城市")& " (" & rs1("区号") & " | " & rs1("省份") &")</option>"
rs1.movenext
wend
rs1.close
set rs1=nothing%>
</select>
</td>
</tr>
<tr>
<td width="80" align="right" height="35">资讯类别:</td>
<td width="480">地方网站
</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">站 名:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="name" size="29" maxlength="10">(5汉字内)</td>
</tr>
<tr>
<td width="80" align="right" height="35">网 址:</td>
<td width="480">
<input type="text" name="url" size="46" value="http://" maxlength="50">(请已http://开头)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">LOGO:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="logo" size="46" value="http://" maxlength="80">(LOGO地址)</td>
</tr>
<tr>
<td width="80" align="right" height="80">介 绍:</td>
<td width="480"><textarea rows="4" name="about" cols="45"></textarea>(20汉字内)</td>
</tr>
<tr>
<td width="80" align="right" height="80" bgcolor="#EBF4FA">站长资料:</td>
<td width="480" bgcolor="#EBF4FA">
<textarea rows="4" name="zhanzhang" cols="45">站长称呼: QQ:
E-mail:
电话:
其它:</textarea><font color="#FF0000">(保密信息)</font></td>
</tr>
<tr>
<td width="560" align="center" height="200" colspan="2">
<iframe name="I1" src="link.htm" marginwidth="1" marginheight="1" width="500" scrolling="no" border="0" frameborder="0" height="187">
浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA"> </td>
<td width="480" bgcolor="#EBF4FA">
<input type="button" value=" 提 交 " name="add" onclick="checkaddsite()">
<input type="reset" value=" 重 置 " name="B2"></td>
</tr></form>
</table>
<!--表单结束-->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760" height="40">
<tr>
<td bgcolor="#88CCFF"> </td>
</tr>
</table>
<!--#include file="copyright.asp" -->
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -