📄 add_zx.asp
字号:
<!--#include file="config.asp" -->
<%
city=trim(request.form("city"))
leibie=trim(request.form("leibie"))
name=trim(request.form("name"))
about=trim(request.form("about"))
address=trim(request.form("address"))
bus=trim(request.form("bus"))
site=trim(request.form("site"))
tel=trim(request.form("tel"))
pic1=trim(request.form("pic1"))
pic2=trim(request.form("pic2"))
pic3=trim(request.form("pic3"))
set rs=server.CreateObject("adodb.recordset")
if len(name)>0 then
rs.open"select * from xinxi where 名称='" &name& "'",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 xinxi",conn,3,3
rs.addnew
rs("名称")=name
rs("城市")=city
rs("类别")=leibie
rs("介绍")=about
rs("地址")=address
rs("公交")=bus
rs("网站")=site
rs("电话")=tel
rs("图片1")=pic1
rs("图片2")=pic2
rs("图片3")=pic3
rs("审核")=-1 '0未审核,-1已审核
rs("推荐")=0 '0不推荐,-1推荐
rs("日期")=date()
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=zx"
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">
<script language="VBScript">
<!--
''=======================================================''
''函数作用:检测添加资讯时的信息是否符合要求
''=======================================================''
function checkaddzx()
if len(add_zx.name.value)=0 then
msgbox"请输入资讯名称!(8汉字内)"
add_zx.name.focus
elseif getStrLen(add_zx.name.value)>16 then
msgbox"咨讯名称请不要超过8个汉字!"
add_zx.name.focus
elseif add_zx.city.value="0" then
msgbox"请选择所在城市!"
add_zx.city.focus
elseif add_zx.leibie.value="0" then
msgbox"请选择资讯类别!"
add_zx.leibie.focus
elseif len(add_zx.about.value)=0 then
msgbox"请输入文字介绍!(240字内)"
add_zx.about.focus
elseif Len(add_zx.about.value)>240 then
msgbox"您的介绍文字太长了,请控制在240个字内!"
add_zx.about.focus
elseif Len(add_zx.address.value)>200 then
msgbox"您输入的地址太长了,请控制在200个字内!"
add_zx.address.focus
elseif Len(add_zx.bus.value)>200 then
msgbox"您输入的公交地址太长了,请控制在200个字内!"
add_zx.bus.focus
elseif Len(add_zx.site.value)>150 then
msgbox"您输入的网址太长了,请控制在150字内!"
add_zx.site.focus
elseif len(add_zx.tel.value)>200 then
msgbox"您输入的电话信息太长了,请控制在200个字内!"
add_zx.tel.focus
elseif len(add_zx.pic1.value)>200 then
msgbox"您输入的图片地址太长了,请控制在200个字符内!"
add_zx.pic1.focus
elseif add_zx.pic2.value<>"http://" and (add_zx.pic1.value="http://" or add_zx.pic1.value="0") then
msgbox"请先填写图片1的地址"
add_zx.pic1.focus
elseif len(add_zx.pic2.value)>200 then
msgbox"您输入的图片地址太长了,请控制在200个字符内!"
add_zx.pic2.focus
elseif add_zx.pic3.value<>"http://" and (add_zx.pic1.value="http://" or add_zx.pic1.value="0" or add_zx.pic2.value="http://" or add_zx.pic2.value="0") then
msgbox"请先填写图片1和图片2的地址"
add_zx.pic1.focus
elseif len(add_zx.pic3.value)>200 then
msgbox"您输入的图片地址太长了,请控制在200个字符内!"
add_zx.pic3.focus
else
add_zx.submit
end if
end function
-->
</script>
</head>
<body leftmargin="0" topmargin="2">
<!--#include file="check.asp" -->
<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="5" cellspacing="0" style="border-collapse: collapse" width="560">
<form method="POST" action="add_zx.asp" name="add_zx"> <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"><select size="1" name="leibie">
<option selected value="0">---请选择类别---</option>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from leibie order by 类别编号",conn,1,1
while not rs.eof
response.write"<option value='" &rs("类别编号")& "'>" &rs("类别名")& "</option>"
rs.movenext
wend
rs.close
set rs=nothing%>
</select>
</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">名 称:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="name" size="16" maxlength="16">(8汉字内)
<a href="add_site.asp">如果您添加网站请点这里</a></td>
</tr>
<tr>
<td width="80" align="right" height="35">介 绍:</td>
<td width="480"><textarea rows="6" name="about" cols="45"></textarea>(240字内)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">地 址:</td>
<td width="480" bgcolor="#EBF4FA">
<textarea rows="5" name="address" cols="45"></textarea>(200字内)</td>
</tr>
<tr>
<td width="80" align="right" height="35">公 交:</td>
<td width="480"><textarea rows="5" name="bus" cols="45"></textarea>(200字内)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">网 站:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="site" size="46" value="http://"></td>
</tr>
<tr>
<td width="80" align="right" height="35">电 话:</td>
<td width="480">
<input type="text" name="tel" size="46"></td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">图 片 1:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="pic1" size="46" value="http://">(图片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35">图 片 2:</td>
<td width="480">
<input type="text" name="pic2" size="46" value="http://">(图片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">图 片 3:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="pic3" size="46" value="http://">(图片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#FFFFFF"> </td>
<td width="480" bgcolor="#FFFFFF">
如果你想推荐你的资讯,请您至少保证填写2张图片介绍!然后留言!<br>
<a href="mailto:Email:d1tz@qq.com">Email:d1tz@qq.com</a><br>
Q Q:339542869<font color="#ff0000">(请勿将此号码公布,欢迎站长、酒吧网吧等负责人添加,保持联系)</font> </td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#FFFFFF"> </td>
<td width="480" bgcolor="#FFFFFF">
<input type="button" value=" 提 交 " name="add" onclick="checkaddzx()">
<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 + -