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

📄 add.asp

📁 鄂尔多斯建站网全站程序(冬季修正版)
💻 ASP
字号:
<!--#include file="session.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="../include/ubb.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="../include/message.asp"-->
<%
'========================================================================================
'以下是“新闻系统”的添加代码,请勿乱修改
if request("action")="add_news" then
dim id,news_title,news_colour,news_person,news_text,news_time
id=request("id")
news_title=request("news_title")
news_colour=request("news_colour")
news_person=request("news_person")
news_text=request("news_text")
news_time=date()
if id="" then
response.write("<script>alert('选择类型不能为空!');history.go(-1)</script>")
response.end
end if
if news_title="" then
response.write("<script>alert('新闻标题不能为空!');history.go(-1)</script>")
response.end
end if
if news_person="" then
response.write("<script>alert('添加人员不能为空!');history.go(-1)</script>")
response.end
end if
if news_text="" then
response.write("<script>alert('新闻内容不能为空!');history.go(-1)</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from news"
rs.open sql,conn,3,3
rs.addnew
rs("id")=id
rs("news_title")=news_title
rs("news_colour")=news_colour
rs("news_person")=news_person
rs("news_text")=news_text
rs("news_time")=news_time
rs.update
rs.Close
set rs=Nothing
response.redirect"edit_news.asp"
end if
'以上是“新闻系统”的添加代码,请勿乱修改
'========================================================================================
'以下是“银行信息”的添加代码,请勿乱修改
if request("action")="add_bank" then
dim bank,banktex,cunzhe,kahao,person,bank_pic
bank=request("bank")
bank_pic=request("bank_pic")
banktex=request("banktex")
cunzhe=request("cunzhe")
kahao=request("kahao")
person=request("person")
if bank="" then
response.write("<script>alert('银行名称不能为空!');history.go(-1)</script>")
response.end
end if
if bank_pic="" then
response.write("<script>alert('银行图标不能为空!');history.go(-1)</script>")
response.end
end if
if banktex="" then
response.write("<script>alert('银行地址不能为空!');history.go(-1)</script>")
response.end
end if
if cunzhe="" then
response.write("<script>alert('存折号码不能为空!');history.go(-1)</script>")
response.end
end if
if kahao="" then
response.write("<script>alert('卡号号码不能为空!');history.go(-1)</script>")
response.end
end if
if person="" then
response.write("<script>alert('用户名称不能为空!');history.go(-1)</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from bank"
rs.open sql,conn,3,3
rs.addnew
rs("bank")=bank
rs("bank_pic")=bank_pic
rs("banktex")=banktex
rs("cunzhe")=cunzhe
rs("kahao")=kahao
rs("person")=person
rs.update
rs.Close
set rs=Nothing
response.redirect"edit_bank.asp"
end if
'以上是“银行信息”的添加代码,请勿乱修改
'========================================================================================
'以下是“管理员添加”的添加代码,请勿乱修改
if request("action")="add_admin_user" then
dim admin_name,admin_pass,admin_pass2
admin_name=trim(request("admin_name"))
admin_pass=trim(request("admin_pass"))
admin_pass2=trim(request("admin_pass2"))
if admin_name="" then
response.write("<script>alert('登陆帐号不能为空!');history.go(-1)</script>")
response.end
end if
if admin_pass="" then
response.write("<script>alert('登陆密码不能为空!');history.go(-1)</script>")
response.end
end if
if admin_pass2="" then
response.write("<script>alert('重复密码不能为空!');history.go(-1)</script>")
response.end
end if
if admin_pass<>admin_pass2 then
response.write("<script>alert('“登陆帐号”与“登陆密码”不能为空!');history.go(-1)</script>")
response.end
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from admin where admin_name='"&admin_name&"'",conn
if not rs.EOF then
response.write("<script>alert('该管理员帐号已经存在');history.go(-1)</script>")
Response.End   
end if
rs.close
sql="select * from admin"
rs.open sql,conn,1,3
rs.addnew
rs("admin_name")=admin_name
rs("admin_pass")=xy20_md5(admin_pass,"short")
rs("flag")="1"
rs.update
rs.Close
set rs=Nothing
response.write"<a href=edit_admin_user.asp>添加管理员成功,返回</a>"
end if
'以上是“管理员添加”的添加代码,请勿乱修改
'========================================================================================
'以下是“栏目添加”的添加代码,请勿乱修改
if request("action")="add_title" then
dim sort_name
sort_name=request("sort_name")
if sort_name="" then
response.write("<script>alert('栏目名称不能为空!');history.go(-1)</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from list"
rs.open sql,conn,3,3
rs.addnew
rs("sort_name")=sort_name
rs.update
rs.Close
set rs=Nothing
response.redirect"edit_title.asp"
end if
'以上是“栏目添加”的添加代码,请勿乱修改
'========================================================================================友情连接
if request("action")="add_friend" then
dim f_s,f_name,f_logo,f_url
f_s=request("f_s")
f_name=request("f_name")
f_logo=request("f_logo")
f_url=request("f_url")
if f_s="" then
response.write("<script>alert('连接位置不能为空!');history.go(-1)</script>")
response.end
end if
if f_name="" then
response.write("<script>alert('连接名称不能为空!');history.go(-1)</script>")
response.end
end if
if f_logo="" then
f_logo="无"
end if
if f_url="" then
response.write("<script>alert('连接地址不能为空!');history.go(-1)</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from friend"
rs.open sql,conn,3,3
rs.addnew
rs("f_s")=f_s
rs("f_name")=f_name
rs("f_logo")=f_logo
rs("f_url")=f_url
rs.update
rs.Close
set rs=Nothing
response.redirect"edit_friend.asp"
end if
'===========================================================================添加商品代码
if request("action")="add_shop" then
id=request("id")
sort_name=request("sort_name")
grade=request("grade")
smalltext=request("smalltext")
largetext=request("largetext")
price=request("price")
attention=request("attention")
tj=request("tj")
if id="" then
response.write("<script>alert('所属类型不能为空!');history.go(-1)</script>")
response.end
end if
if sort_name="" then
response.write("<script>alert('商品名称不能为空!');history.go(-1)</script>")
response.end
end if
if grade="" then
response.write("<script>alert('商品图片不能为空!');history.go(-1)</script>")
response.end
end if
if smalltext="" then
response.write("<script>alert('小 简 介不能为空!');history.go(-1)</script>")
response.end
end if
if largetext="" then
response.write("<script>alert('大 简 介不能为空!');history.go(-1)</script>")
response.end
end if
if price="" then
response.write("<script>alert('普通价格不能为空!');history.go(-1)</script>")
response.end
end if
if attention="" then
response.write("<script>alert('注意事项不能为空!');history.go(-1)</script>")
response.end
end if
if tj="" then
response.write("<script>alert('首页推荐不能为空!');history.go(-1)</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from sort" 
rs.open sql,conn,1,3
rs.AddNew
rs("id")=id
rs("sort_name")=sort_name
rs("grade")=grade
rs("smalltext")=smalltext
rs("largetext")=largetext
rs("price")=price
rs("attention")=attention
rs("tj")=tj
rs.Update
rs.Close
set rs=nothing
response.redirect"edit_shop.asp"
end if
'=================================================答复问题
if request("action")="c_4_a" then
id=request("id")
c_4_answer=request("c_4_answer")
if c_4_answer="" then
response.write("<script>alert('没有回答不能提交');history.go(-1)</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from control_4 where id="&request("id") 
rs.open sql,conn,1,3
rs("c_4_answer")=c_4_answer
rs("c_4")="1"
rs.Update
rs.Close
set rs=nothing
response.redirect"control_4.asp"
end if
'==================================================添加推荐客户
if request("action")="add_customer" then
id=request("id")
c_name=request("c_name")
c_url=request("c_url")
if id="" then
response.write("<script>alert('客户类别没有选择');history.go(-1)</script>")
response.end
end if
if c_name="" then
response.write("<script>alert('网站名称不能为空');history.go(-1)</script>")
response.end
end if
if c_url="" then
response.write("<script>alert('网站网址不能为空');history.go(-1)</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from customer" 
rs.open sql,conn,1,3
rs.AddNew
rs("id")=id
rs("c_name")=c_name
rs("c_url")=c_url
rs.Update
rs.Close
set rs=nothing
response.redirect"edit_customer.asp"
end if
'==================================================添加广告代码
if request("action")="add_ad" then
ad_w=request("ad_w")
html_w=request("html_w")
mo=request("mo")
if mo="" then
kuan=request("kuan")
gao=request("gao")
elseif mo<>"" then
kuan="0"
gao="0"
end if
ad_pic=request("ad_pic")
ad_url=request("ad_url")
ad_wenzi=request("ad_wenzi")
ad_html=request("ad_html")


if ad_w="" then
response.write("<script>alert('广告分类没有选择');history.go(-1)</script>")
response.end
end if

if request("html_w")="0" then
if kuan="" then
response.write("<script>alert('宽没有填入像素');history.go(-1)</script>")
response.end
end if
if gao="" then
response.write("<script>alert('高没有填入像素');history.go(-1)</script>")
response.end
end if
if ad_pic="" then
response.write("<script>alert('广告图片没有填写');history.go(-1)</script>")
response.end
end if
if ad_url="" then
response.write("<script>alert('连接地址没有填写');history.go(-1)</script>")
response.end
end if
if ad_wenzi="" then
response.write("<script>alert('文字说明没有填写');history.go(-1)</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ad" 
rs.open sql,conn,1,3
rs.AddNew
rs("ad_w")=ad_w
rs("html_w")=html_w
rs("kuan")=kuan
rs("gao")=gao
rs("ad_pic")=ad_pic
rs("ad_url")=ad_url
rs("ad_wenzi")=ad_wenzi
rs("ad_html")="-"
rs("ad_time")=now()
rs.Update
rs.Close
set rs=nothing
response.redirect"edit_ad.asp"
else
if ad_html="" then
response.write("<script>alert('HTML代码没有填写');history.go(-1)</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ad" 
rs.open sql,conn,1,3
rs.AddNew
rs("ad_w")=ad_w
rs("html_w")=html_w
rs("kuan")="-"
rs("gao")="-"
rs("ad_pic")="-"
rs("ad_url")="-"
rs("ad_wenzi")="-"
rs("ad_html")=ad_html
rs("ad_time")=now()
rs.Update
rs.Close
set rs=nothing
response.redirect"edit_ad.asp"
end if
end if
'==================================================
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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