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

📄 editad.asp

📁 一个综合类整站
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="conn.asp"-->
<%if session("china_admin")="" then
response.redirect "login.asp"
end if

dim theid,dtitle,dcolor,dbgcolor1,dcu,dlei,dispic,dpic,dtext,dstop,dtop,dhotpoto,dlift,dmoney,sql,rs
theid=request("id")
if isnumeric(theid)=false then
response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
response.end
end if

dtitle=HtmlEncode(trim(request.form("dtitle")))
dcolor=HtmlEncode(trim(request.form("dcolor")))
dbgcolor1=HtmlEncode(trim(request.form("dbgcolor1")))
dcu=HtmlEncode(trim(request.form("dcu")))
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=HtmlEncode(trim(request.form("dstop")))
dtop=HtmlEncode(trim(request.form("dtop")))
shouye=HtmlEncode(trim(request.form("shouye")))
hotpoto=HtmlEncode(trim(request.form("hotpoto")))
lift=HtmlEncode(trim(request.form("lift")))
dmoney=HtmlEncode(trim(request.form("dmoney")))
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")))

if dmoney<>"" then
  if isnumeric(dmoney)=false then
  response.write "<script>alert('信息费用请填写数字,立即返回!');history.back();</script>"
  response.end
  end if
end if

if city_oneid<>"" 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
set rs=nothing
end if

if type_oneid<>"" then
set rs=server.createobject("adodb.recordset")
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
end  if
sql="select * from china_data where adid="&theid
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3


pic=rs("pic")
text=rs("text")
username=rs("username")
cardid=rs("cardid")
tel=rs("tel")
time1=rs("time")
stop1=rs("stop")
top1=rs("top")
shouye1=rs("shouye")
lift1=rs("lift")
hot1=rs("hot")
money=rs("money")
mark1=rs("mark")
hotpoto1=rs("hotpoto")


if dtitle<>"" then
rs("title")=dtitle
rs("color")=dcolor
rs("bgcolor1")=dbgcolor1
rs("cu")=dcu
rs("city_oneid")=city_oneid
rs("city_one")=city_one
rs("city_two")=city_two
if city_twoid="" then city_twoid=0
rs("city_twoid")=city_twoid
if city_threeid="" then city_threeid=0
rs("city_three")=city_three
rs("city_threeid")=city_threeid
rs("type_oneid")=type_oneid
rs("type_one")=type_one
if type_twoid="" then type_twoid=0
rs("type_twoid")=type_twoid
rs("type_two")=type_two
if type_threeid="" then type_threeid=0
rs("type_threeid")=type_threeid
rs("type_three")=type_three
rs("ispic")=dispic
if dpic="http://" then
dpic=""
end if
if rs("pic")<>dpic then
if rs("pic")<>"" and lcase(left(rs("pic"),7))<>"http://" then
'''''''''''删除图片开始''''''''''''''''
 Set fdel = CreateObject("Scripting.FileSystemObject")	
              tempImageDir = Server.MapPath("../adpic/"&rs("pic")&"")
	             fdel.DeleteFile(tempImageDir)
set fdel=nothing
'''''''''''删除图片结束'''''''''''''''
end if
rs("pic")=dpic
end if
rs("text")=dtext
rs("username")=dusername
rs("cardid")=dcardid
rs("tel")=dtel
rs("stop")=dstop
rs("top")=dtop
if dmoney = "" then dmoney = 0
rs("money")=dmoney
rs("time")=request.form("time")
rs("mark")=request.form("mark")
rs("shouye")=shouye
rs("hotpoto")=hotpoto
rs("lift")=lift
rs("hot")=request.form("hot")
rs.update
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="&theid&""

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/"&theid&".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"
response.end
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];

                                 var intTemp=0;

⌨️ 快捷键说明

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