📄 addad.asp
字号:
<!--#include file="conn.asp"-->
<%if session("china_admin")="" then
response.redirect "login.asp"
end if
dim dtitle,dcolor,dbgcolor1,dcu,dlei,dispic,dpic,dtext,dstop,dtop,dhotpoto,dlift,dmoney,sql,rs
dim city_one,city_two,city_three,type_one,type_two,type_three,city_oneid,city_twoid,city_threeid,type_oneid,type_twoid,type_threeid
dtitle=HtmlEncode(trim(request.form("dtitle")))
dcolor=HtmlEncode(trim(request.form("dcolor")))
dbgcolor1=HtmlEncode(trim(request.form("dbgcolor1")))
dcu=HtmlEncode(trim(request.form("dcu")))
city_oneid=HtmlEncode(trim(request.form("city_one")))
city_twoid=HtmlEncode(trim(request.form("city_two")))
city_threeid=HtmlEncode(trim(request.form("city_three")))
type_oneid=HtmlEncode(trim(request.form("type_one")))
type_twoid=HtmlEncode(trim(request.form("type_two")))
type_threeid=HtmlEncode(trim(request.form("type_three")))
dlei=HtmlEncode(trim(request.form("dlei")))
dispic=HtmlEncode(trim(request.form("dispic")))
dpic=HtmlEncode(trim(request.form("dpic")))
dtext=HtmlEncode2(request.form("dtext"))
dusername=HtmlEncode(trim(request.form("dusername")))
dcardid=HtmlEncode(trim(request.form("dcardid")))
dtel=HtmlEncode(trim(request.form("dtel")))
dstop=dateadd("d",request.form("dstop"),date())
dtop=HtmlEncode(trim(request.form("dtop")))
dshouye=HtmlEncode(trim(request.form("dshouye")))
dhotpoto=HtmlEncode(trim(request.form("dhotpoto")))
dlift=HtmlEncode(trim(request.form("dlift")))
dhot=HtmlEncode(trim(request.form("dhot")))
dmoney=HtmlEncode(trim(request.form("dmoney")))
if dmoney<>"" then
if isnumeric(dmoney)=false then
response.write "<script>alert('信息费用请填写数字,立即返回!');history.back();</script>"
response.end
end if
end if
if dtitle<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select city from china_city where twoid=0 and threeid=0 and id="&city_oneid,conn,1,1
city_one=rs("city")
rs.close
if city_twoid<>"" then
rs.open "select city from china_city where id="&city_oneid&" and threeid=0 and twoid="&city_twoid,conn,1,1
city_two=rs("city")
rs.close
end if
if city_twoid<>"" and city_threeid<>"" then
rs.open "select city from china_city where id="&city_oneid&" and twoid="&city_twoid&" and threeid="&city_threeid,conn,1,1
city_three=rs("city")
rs.close
end if
rs.open "select name from china_type where twoid=0 and threeid=0 and id="&type_oneid,conn,1,1
type_one=rs("name")
rs.close
if type_twoid<>"" then
rs.open "select name from china_type where id="&type_oneid&" and threeid=0 and twoid="&type_twoid,conn,1,1
type_two=rs("name")
rs.close
end if
if type_twoid<>"" and type_threeid<>"" then
rs.open "select name from china_type where id="&type_oneid&" and twoid="&type_twoid&" and threeid="&type_threeid,conn,1,1
type_three=rs("name")
rs.close
end if
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from china_data"
rs.open sql,conn,1,3
rs.addnew
if city_twoid="" then city_twoid=0
if city_threeid="" then city_threeid=0
if type_twoid="" then type_twoid=0
if type_threeid="" then type_threeid=0
rs("city_oneid")=city_oneid
rs("city_one")=city_one
rs("city_two")=city_two
rs("city_twoid")=city_twoid
rs("city_three")=city_three
rs("city_threeid")=city_threeid
rs("type_oneid")=type_oneid
rs("type_one")=type_one
rs("type_twoid")=type_twoid
rs("type_two")=type_two
rs("type_threeid")=type_threeid
rs("type_three")=type_three
rs("title")=dtitle
rs("color")=dcolor
rs("bgcolor1")=dbgcolor1
rs("cu")=dcu
rs("ispic")=dispic
if dpic="http://" then
dpic=""
end if
rs("pic")=dpic
rs("text")=dtext
rs("username")=dusername
rs("cardid")=dcardid
rs("tel")=dtel
rs("stop")=dstop
rs("top")=dtop
rs("shouye")=dshouye
rs("hotpoto")=dhotpoto
rs("lift")=dlift
rs("hot")=dhot
if dmoney = "" then dmoney = 0
rs("money")=dmoney
rs("mark")="yes"
rs.update
rs.close
sql="select adid from china_data order by adid desc"
rs.open sql,conn,1,1
id=rs("adid")
rs.close
set rs=nothing
conn.close
set conn=nothing
''''''''''''''''''生成html开始''''''''''''''''''''''''''
ServerURL=CStr(Request.ServerVariables("SCRIPT_NAME"))
n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
ServerURL=left(ServerURL, n-1)'显示从左边数第"n-1"个字符前面的字符,
n=InStrRev(ServerURL,"/") '从右边第一个字符起查找"_"的位置,n为返回值
ServerURL=left(ServerURL, n)'显示从左边数第"n"个字符前面的字符,
ServerURL="http://"&Request.ServerVariables("SERVER_NAME")&""&ServerURL&"show.asp?id="&id&""
Set Mail1 = Server.CreateObject("CDO.Message")
Mail1.CreateMHTMLBody ServerURL,31
AA=Mail1.HTMLBody
Set Mail1 = Nothing
set objfso = Server.CreateObject("Scripting.FileSystemObject")
set htmout = objfso.CreateTextFile(server.mappath("../html/"&id&".htm"))
AA=replace(AA,"adpic/","../adpic/")
AA=replace(AA,"link.asp","../link.asp")
AA=replace(AA,"link_img.asp","../link_img.asp")
AA=replace(AA,"index.asp","../index.asp")
AA=replace(AA,"114/../index.asp","../114/index.asp")
AA=replace(AA,"ad.asp","../ad.asp")
AA=replace(AA,"TV.asp","../tv.asp")
AA=replace(AA,"user.asp","../user.asp")
AA=replace(AA,"gbook.asp","../gbook.asp")
AA=replace(AA,"city.asp","../city.asp")
AA=replace(AA,"post.asp","../post.asp")
AA=replace(AA,"city_more.asp","../city_more.asp")
AA=replace(AA,"reg.asp","../reg.asp")
AA=replace(AA,"login.asp","../login.asp")
AA=replace(AA,"search.asp","../search.asp")
AA=replace(AA,"114/join.asp","../114/join.asp")
AA=replace(AA,"fabu.asp","../fabu.asp")
AA=replace(AA,"type.asp","../type.asp")
AA=replace(AA,"show.asp","../show.asp")
AA=replace(AA,"114/qy../login.asp","../114/qylogin.asp")
AA=replace(AA,"rq_message.asp","../rq_message.asp")
AA=replace(AA,"top.asp","../top.asp")
AA=replace(AA,"money.asp","../money.asp")
AA=replace(AA,"pic.asp","../pic.asp")
AA=replace(AA,"bbs/","../bbs/")
AA=replace(AA,"html/","")
AA=replace(AA,"ip.asp","../ip.asp")
AA=replace(AA,"phone.asp","../phone.asp")
AA=replace(AA,"about.asp","../about.asp")
AA=replace(AA,"send_zn_message.asp","../send_zn_message.asp")
htmout.write replace(AA,"images/","../images/")
htmout.close
set htmout=nothing
set objfso=nothing
''''''''''''''''''生成html结束''''''''''''''''''''''''''
response.redirect "ok.asp"
end if%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>发布信息</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function checkadd()
{
//检查年月日是否是合法日期
function isdate(intYear,intMonth,intDay){
if(isNaN(intYear)||isNaN(intMonth)||isNaN(intDay)) return false;
if(intMonth>12||intMonth<1) return false;
if ( intDay<1||intDay>31)return false;
if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intDay>30)) return false;
if(intMonth==2){
if(intDay>29) return false;
if((((intYear%100==0)&&(intYear%400!=0))||(intYear%4!=0))&&(intDay>28))return false;
}
return true;
}
//检查身份证是否是正确格式
function checkCard(dcardid)
{
var pattern;
if (dcardid.length==15)
{
pattern= /^\d{15}$/;//正则表达式,15位且全是数字
if (pattern.exec(dcardid)==null)
{
alert("15位身份证号码必须为数字!")
return false;
}
if (!isdate("19"+dcardid.substring(6,8),dcardid.substring(8,10),dcardid.substring(10,12)))
{
alert("身份证号码中所含日期不正确")
return false;}
}
else if (dcardid.length==18)
{
pattern= /^\d{17}(\d|x|X)$/;//正则表达式,18位且前17位全是数字,最后一位只能数字,x,X
if (pattern.exec(dcardid)==null)
{
alert("18位身份证号码必须为数字!")
return false;
}
if (!isdate(dcardid.substring(6,10),dcardid.substring(10,12),dcardid.substring(12,14)))
{
alert("身份证号码中所含日期不正确")
return false;
}
var strJiaoYan =[ "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
var intQuan =[7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -