⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_city.asp

📁 CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。
💻 ASP
字号:
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="add_config.asp" -->
<!--#include file="sub_change.asp" -->
<%
if siteread="yes" then response.redirect "error.asp?v=siteread"  end if

dim ok
ok=strchange(left(trim(request.QueryString("ok")),1))

dim errormax,pov,povmax,city,quhao,quhaomax,about,aboutmax
aboutmax=100
errormax=""

if ok="y" then
  pov=strchange(trim(request.form("pov")))
  if len(pov)=0 or pov="0" then errormax="省份名称不能为空!<br>" end if
  
  city=strchange(trim(request.form("city")))
  if len(city)=0 or city="0" then errormax=errormax&"城市名称不能为空!<br>" end if
  if len(city)>citynamemax then errormax=errormax&"城市名称超过系统最大字符数" &citynamemax&",目前字符数:"&len(city)&"!<br>" end if
  if len(guolv(city))>0 then errormax=errormax&"城市名称中数据“"&guolv(city)&"”被系统过滤!<br>" end if
  if right(city,1)="县" then errormax=errormax&"暂不接受县级地方,请谅解!<br>" end if
  if right(city,1)="乡" then errormax=errormax&"暂不接受乡级地方,请谅解!<br>" end if
  if right(city,1)="镇" then errormax=errormax&"暂不接受镇级地方,请谅解!<br>" end if
  if right(city,1)="区" then errormax=errormax&"暂不接受区级地方,请谅解!<br>" end if
  if right(city,1)="市" then errormax=errormax&"请取消城市后缀,如西安市填写 西安 !<br>" end if
  
  quhao=strchange(trim(request.form("quhao")))
  if len(quhao)>4 or len(quhao)<3 then errormax=errormax&"城市区号请填写数字,<font face='Arial'>3~4</font>,目前字符数:"&len(quhao)&"!<br>" end if
  if len(guolv(quhao))>0 then errormax=errormax&"城市区号中数据“"&guolv(quhao)&"”被系统过滤!<br>" end if  
  
  about=strchange(trim(request.form("about")))
  if len(about)=0 then 
    errormax=errormax&"城市介绍不能为空!<br>"
    about="如果你有本页没有刊登或者刊登错误的本地资讯场所的最新信息,请告诉我们!"
  end if
  if len(about)>aboutmax then errormax=errormax&"城市介绍超过系统最大字符数" &aboutmax&",目前字符数:"&len(about)&"!<br>" end if
  if len(guolv(about))>0 then errormax=errormax&"城市介绍中数据“"&guolv(about)&"”被系统过滤!<br>" end if
  
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") 
  
  if len(errormax)>0 then 
    errormax="抱歉:以下字段数据需要修改。<br>" & errormax
  else 
    set rs=server.CreateObject("adodb.recordset")
    rs.open"select * from 城市 where 城市='"&city&"'",conn,1,1
    if rs.recordcount<>0 then
      if rs("审核")=1 then
        errormax="抱歉!该城市已经存在且已通过审核,无须添加!"
      else
        errormax="抱歉!该城市已经存在但尚未通过审核,请稍候再试!"
      end if
      rs.close
      set rs=nothing
    else
      rs.close
      rs.open "select * from 城市",conn,3,3
      rs.addnew
      rs("城市")=city
      rs("省份")=pov
      rs("区号")=quhao
      rs("简介")=about
      rs("审核")=sitepass 
      rs("推荐数")=0
      rs("人气")=100
      rs("排名")=1000
      rs("修改")="新信息|"&now()&"|"&userip
      rs.update
      rs.close
      set rs=nothing
      if sitepass=1 then
        response.write "<center style='font-size: 12pt; line-height:20pt'>感谢您添加城市!审核已经通过,您现在就可以查看您刚才发布的城市信息!<br>正在转入 ....<br><a href='info.asp?ct="&city&"'>&gt;&gt;点击这里返回首页&lt;&lt;</a></center><meta http-equiv=refresh content=5;URL='info.asp?ct="&city&"'>" 
        response.end
      else
        response.write "<center style='font-size: 12pt; line-height:20pt'>感谢您添加城市!等待管理员审核,请稍后查看!<br>正在返回首页 ....<br><a href=index.asp>&gt;&gt;点击这里返回首页&lt;&lt;</a></center><meta http-equiv=refresh content=5;URL='index.asp'>" 
        response.end
      end if
    end if
  end if
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">
<link href="skin/style_<%=trim(request.cookies("skin_color"))%>.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="2">
<noscript><iframe src="*.htm"></iframe></noscript>
<div align="<%=sitealign%>">
<!--#include file="title.asp" -->
<!--#include file="add_menu.asp" -->
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="760" height="90">
  <tr>
    <td class="add" align="center" width="200">添加城市</td>
    <td class=t1 align="center" width="60"> </td>
    <td align="left" width="500"><%=msg_add_city%></td>
  </tr>
</table>
<table border="0" cellpadding="10" cellspacing="0" style="border-collapse: collapse" width="760">
  <tr>
    <td align="left" style="color: #FF0000; font-size: 10pt"><%=errormax%></td>
  </tr>
</table>  
<table border="1" cellpadding="5" style="border-collapse: collapse;" width="720" bordercolor="#FFFFFF">
  <form method="POST" action="add_city.asp?ok=y" name="add_info">
  <tr>
    <td width="200" align="center" height="6" bgcolor="#3399FF"></td>
    <td width="510" bgcolor="#CCCCCC"></td>
  </tr>
  <tr>
    <td width="200" align="center" height="35" bgcolor="#B3DEE8">所在省份:</td>
    <td bgcolor="#F5F5F5">
      <select name="pov" style="width: 150" size="1">
        <option value='0'>请选择省份</option>
        <option value='0'>-----------------</option>
          <%set rspov=server.CreateObject("adodb.recordset")
          rspov.open "select * from 省份 where 审核=1 order by 排名 asc",conn,1,1
          do while not (rspov.eof or rspov.bof)
            if rspov("省份")=pov then
              response.write"<option value='" &rspov("省份")& "' selected class='red'>" &rspov("省份全称")& "</option>"
            else
              response.write"<option value='" &rspov("省份")& "'>" &rspov("省份全称")& "</option>"
            end if
            rspov.movenext
          loop
		  rspov.close
		  set rspov=nothing%>
      </select><br>单项选择
    </td>
  </tr>
  <tr>
    <td align="center" height="35" bgcolor="#B3DEE8">城市名称:</td>
    <td bgcolor="#F5F5F5">
      <input type="text" name="city" size="21" maxlength="16" value="<%=city%>">最多<%=citynamemax%>字符<br>
		填写城市名称请勿填写“市、县、乡”等后缀,例:西安市填写<b>西安</b>。<font color="red">暂不接受县、乡等地方。</font>
	</td>
  </tr>
  <tr>
    <td align="center" height="35" bgcolor="#B3DEE8">城市区号:</td>
    <td bgcolor="#F5F5F5">
      <input type="text" name="quhao" size="21" maxlength="16" value="<%=quhao%>"><br><font face="Arial">3~4</font>位,例如:深圳填写0755</td>
  </tr>
  <tr>
    <td align="center" height="35" bgcolor="#B3DEE8">城市介绍:</td>
    <td bgcolor="#F5F5F5"><textarea rows="6" name="about" cols="61"><%=about%></textarea><br>最多<%=aboutmax%>字符</td>
  </tr>
  <tr>
    <td width="200" align="center" height="6" bgcolor="#3399FF"></td>
    <td bgcolor="#CCCCCC"></td>
  </tr>
  <tr>
    <td align="center" height="70" colspan="2">
	<input type="submit" value="   提   交   " name="add">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input type="reset" value=" 重 置 " name="B2"></td>
  </tr></form>
</table> 
<!--#include file="copyright.asp" --> 
<br><br>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -