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

📄 add_info.asp

📁 CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="add_config.asp" -->
<!--#include file="sub_change.asp" -->
<%

Response.Write eWebEditor_DeCode(sContent, "SCRIPT, OBJECT, TABLE")

%>
<%
if siteread="yes" then response.redirect "error.asp?v=siteread"  end if

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

dim errormax,citymax,leibie,leibiemax,name,namemax,about,aboutmax,address,addressmax,bus,busmax,pay,paymax,site,sitemax,tel,telmax,qq,qqmax,pic1,pic2,pic3,pic4,picmax,other,othermax,boss,bossmax,password,userip
citymax=4
leibiemax=4
namemax=12
aboutmax=240
addressmax=200
busmax=200
paymax=200
sitemax=100
telmax=100
qqmax=20
picmax=200
othermax=800
bossmax=200
passwordmax=18
errormax=""

if ok="y" then
  city=strchange(trim(request.form("city")))
  if len(city)=0 or city="0" then 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  
  
  leibie=strchange(trim(request.form("leibie")))
  if len(leibie)=0 or leibie="0" then errormax=errormax&"资讯类别不能为空!<br>" end if
  if len(leibie)>leibiemax then errormax=errormax&"资讯类别超过系统最大字符数" &leibiemax&",目前字符数:"&len(leibie)&"!<br>" end if
  if len(guolv(leibie))>0 then errormax=errormax&"资讯类别中数据“"&guolv(leibie)&"”被系统过滤!<br>" end if
  
  name=strchange(trim(request.form("name")))
  if len(name)=0 then errormax=errormax&"资讯名称不能为空!<br>" end if
  if len(name)>namemax then errormax=errormax&"资讯名称超过系统最大字符数" &namemax&",目前字符数:"&len(name)&"!<br>" end if
  if len(guolv(name))>0 then errormax=errormax&"资讯名称中数据“"&guolv(name)&"”被系统过滤!<br>" end if  
  
  about=strchange(trim(request.form("about")))
  if len(about)=0 then errormax=errormax&"资讯介绍不能为空!<br>" 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
  
  address=strchange(trim(request.form("address")))
  if len(address)>addressmax then errormax=errormax&"资讯地址超过系统最大字符数" &addressmax&",目前字符数:"&len(address)&"!<br>" end if
  if len(guolv(address))>0 then errormax=errormax&"资讯地址中数据“"&guolv(address)&"”被系统过滤!<br>" end if
  
  bus=strchange(trim(request.form("bus")))
  if len(bus)>busmax then errormax=errormax&"公交线路超过系统最大字符数" &busmax&",目前字符数:"&len(bus)&"!<br>" end if
  if len(guolv(bus))>0 then errormax=errormax&"公交线路中数据“"&guolv(bus)&"”被系统过滤!<br>" end if
  
  pay=strchange(trim(request.form("pay")))
  if len(pay)>paymax then errormax=errormax&"消费情况超过系统最大字符数" &paymax&",目前字符数:"&len(pay)&"!<br>" end if
  if len(guolv(pay))>0 then errormax=errormax&"消费情况中数据“"&guolv(pay)&"”被系统过滤!<br>" end if
  
  site=strchange(trim(request.form("site")))
  if len(site)>sitemax then errormax=errormax&"资讯网站超过系统最大字符数" &sitemax&",目前字符数:"&len(site)&"!<br>" end if
  if len(guolv(site))>0 then errormax=errormax&"资讯网站中数据“"&guolv(site)&"”被系统过滤!<br>" end if
  
  tel=strchange(trim(request.form("tel")))
  if len(tel)>telmax then errormax=errormax&"联系电话超过系统最大字符数" &telmax&",目前字符数:"&len(tel)&"!<br>" end if
  if len(guolv(tel))>0 then errormax=errormax&"联系电话中数据“"&guolv(tel)&"”被系统过滤!<br>" end if
  
  qq=strchange(trim(request.form("qq")))
  if len(qq)>qqmax then errormax=errormax&"腾讯QQ超过系统最大字符数" &qqmax&",目前字符数:"&len(qq)&"!<br>" end if
  if len(guolv(qq))>0 then errormax=errormax&"腾讯QQ中数据“"&guolv(qq)&"”被系统过滤!<br>" end if
  
  pic1=strchange(trim(request.form("pic1")))
  if len(pic1)>picmax then errormax=errormax&"图 片 1超过系统最大字符数" &picmax&",目前字符数:"&len(pic1)&"!<br>" end if
  if len(guolv(pic1))>0 then errormax=errormax&"图 片 1中数据“"&guolv(pic1)&"”被系统过滤!<br>" end if
  
  pic2=strchange(trim(request.form("pic2")))
  if len(pic2)>picmax then errormax=errormax&"图 片 2超过系统最大字符数" &picmax&",目前字符数:"&len(pic2)&"!<br>" end if
  if len(guolv(pic2))>0 then errormax=errormax&"图 片 2中数据“"&guolv(pic2)&"”被系统过滤!<br>" end if
  
  pic3=strchange(trim(request.form("pic3")))
  if len(pic3)>picmax then errormax=errormax&"图 片 3超过系统最大字符数" &picmax&",目前字符数:"&len(pic3)&"!<br>" end if
  if len(guolv(pic3))>0 then errormax=errormax&"图 片 3中数据“"&guolv(pic3)&"”被系统过滤!<br>" end if
  
  pic4=strchange(trim(request.form("pic4")))
  if len(pic4)>picmax then errormax=errormax&"图 片 4超过系统最大字符数" &picmax&",目前字符数:"&len(pic4)&"!<br>" end if
  if len(guolv(pic4))>0 then errormax=errormax&"图 片 4中数据“"&guolv(pic4)&"”被系统过滤!<br>" end if
  
  other=strchange(trim(request.form("other")))
  if len(other)>othermax then errormax=errormax&"其它信息超过系统最大字符数" &othermax&",目前字符数:"&len(other)&"!<br>" end if
  if len(guolv(other))>0 then errormax=errormax&"其它信息中数据“"&guolv(other)&"”被系统过滤!<br>" end if
  
  boss=strchange(trim(request.form("boss")))
  if len(boss)>bossmax then errormax=errormax&"老板信息超过系统最大字符数" &bossmax&",目前字符数:"&len(boss)&"!<br>" end if
  if len(guolv(boss))>0 then errormax=errormax&"老板信息中数据“"&guolv(boss)&"”被系统过滤!<br>" end if
  
  password=strchange(trim(request.form("password")))
  if len(password)<>0 then errormax=errormax&"管理密码暂时不能填写,如果您是该资讯负责人请向系统管理员索取管理密码!<br>" end if
  if not(len(password)>=6 and len(password)<=18 or len(password)=0) then errormax=errormax&"管理密码6~18位!<br>" end if
  if len(guolv(password))>0 then errormax=errormax&"管理密码中数据“"&guolv(password)&"”被系统过滤!<br>" end if
  
  if len(errormax)>0 then 
    errormax="抱歉:以下字段数据需要修改。<br>" & errormax
  else
    dim pov,quhao
    set rspov=server.CreateObject("adodb.recordset")
    rspov.open "select * from 城市 where 审核=1 and 城市='" & city & "'",conn,1,1
    if rspov.recordcount=1 then
      pov=rspov("省份")
      quhao=rspov("区号")
    else
      response.write "<Script Language=JavaScript>alert('抱歉!程序此处逻辑错误!错误代码:Add_info_1。请和系统管理员联系 QQ:"&adminqq&"');</Script>"
      response.write "<center style='font-size: 12pt; line-height:20pt'>2秒后返回首页或<a href=index.asp>点击这里</a>返回</center><meta http-equiv=refresh content=5;URL=index.asp>"
      response.end
    end if
    rspov.close
    set rspov=nothing
    
    set rs=server.CreateObject("adodb.recordset")
    rs.open"select * from 资讯 where 名称='"&name&"' and 城市='"&city&"'",conn,1,1
    if rs.recordcount>1 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("名称")=name
      rs("省份")=pov
      rs("城市")=city
      rs("区号")=quhao
      rs("类别")=leibie
      rs("介绍")=about
      rs("地址")=address
      rs("消费")=pay
      rs("公交")=bus
      rs("网站")=site
      rs("电话")=tel
      rs("即时通讯")=qq
      rs("图片1")=pic1
      rs("图片2")=pic2
      rs("图片3")=pic3
      rs("图片4")=pic4
      rs("其他")=other
      rs("老板信息")=boss
      rs("管理密码")=password
      'dim randomnum
      'randomize
      'randomnum=int(rnd*100)+1
      'rs("管理密码")="password:#"&date()&"#"&userip&"#"& randomnum
            
      rs("推荐指数")=0
      rs("排名")=100
      rs("推荐")=0
      rs("锁定")=0
      rs("审核")=sitepass
      rs("日期")=now()
      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=index.asp>&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='info.asp?ct="&city&"'>" 
        response.end

⌨️ 快捷键说明

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