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

📄 wapls_admin_conn.asp

📁 蓝色WAP建站系统,WAP源码,更多请登陆http://xywap.cn
💻 ASP
字号:
<%
'==================================
'=文 件 名:wapls_admin_conn.asp
'=适用版本:游戏天府WAP网站管理系统(CMS)V1.1
'=官方版权:http://www.gotf.cn
'=文件功能:后台系统管理参数调用
'=文件作者:游戏天府
'=发行时间:2007-02-01
'==================================
on error resume next
'==================================
'=功    能:数据库地址设置,根据相应情况作更改,名称越复杂越好。
'==================================
dim conn,connstr,db
db="../mdb/mdb.mdb"
connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(db)
set conn = server.createobject("adodb.connection")
conn.open connstr
	if err then
		err.clear
		set conn = nothing
		response.write "数据库连接出错.请检查连接字串."
		response.end
	end if
'==================================
'=功    能:参数的调用
'==================================
dim sqlconfig
	Set rsconfig=Server.CreateObject("Adodb.Recordset")
		Sqlconfig = "select * from wapls_config"
	rsconfig.open sqlconfig,conn,1,1
	'=====网站基本信息=====
	mb=rsconfig("mb")
	wapls_sessionvar=rsconfig("wapls_sessionvar")
	wapls_sessiondown=rsconfig("wapls_sessiondown")
	adminlogincode=rsconfig("adminlogincode")
	admintime=rsconfig("admintime")
	const1=rsconfig("const1")
	wapname=rsconfig("wapname")
	wapurl=rsconfig("wapurl")
	wapboss=rsconfig("wapboss")
	wapday=rsconfig("wapday")
	wapemail=rsconfig("wapemail")
	waplogo=rsconfig("waplogo")
	waplogoname=rsconfig("waplogoname")
	wapbeian=rsconfig("wapbeian")
	up=rsconfig("up")
	down=rsconfig("down")
	onlinetime=rsconfig("onlinetime")
	softremark_ok=rsconfig("softremark_ok")
	artremark_ok=rsconfig("artremark_ok")
	newsremark_ok=rsconfig("newsremark_ok")
	web_ok=rsconfig("web_ok")
	addbook_ok=rsconfig("addbook_ok")
	addlink_ok=rsconfig("addlink_ok")
	book_ok=rsconfig("book_ok")
	link_ok=rsconfig("link_ok")
	'=====会员系统设置=====
	user_system=rsconfig("user_system")
	user_session=rsconfig("user_session")
	user_add=rsconfig("user_add")
	user_startmoney=rsconfig("user_startmoney")
	user_startexper=rsconfig("user_startexper")
	user_addexper=rsconfig("user_addexper")
	'=====上传设置=====
	allowupfile=rsconfig("allowupfile")
	allowupfilesize=rsconfig("allowupfilesize")
	'=====访问限制=====
	replace_ip=rsconfig("replace_ip")
	replace_ip1=rsconfig("replace_ip")
	sqlin_ok1=rsconfig("sqlin_ok1")
	replace_word=rsconfig("replace_word")
	sqlin_ok=rsconfig("sqlin_ok")
	'=====网站状态设置=====
	weihu=rsconfig("weihu")
	weihu_case=rsconfig("weihu_case")
	weihu_time=rsconfig("weihu_time")
	'=====首页显示设置=====
	indexnews=rsconfig("indexnews")
	indexarticle=rsconfig("indexarticle")
	indexsoft=rsconfig("indexsoft")
	indexlink=rsconfig("indexlink")
	'=====其它页面显示选项=====
	pagenum=rsconfig("pagenum")
	help=rsconfig("help")
	userkey=rsconfig("zckey")
	pageremark=rsconfig("pageremark")

Rsconfig.close
set rsconfig=nothing
function utf8(str)
if str="" or isnull(str) then
	tohtm=str
	exit function
end if
utf8 = replace(str,"&","&amp;")
utf8 = replace(utf8,"","&quot;")
utf8 = replace(utf8,"<","&lt;")
utf8 = replace(utf8,">","&gt;")
utf8 = replace(utf8," ","&nbsp;")
utf8 = replace(utf8,"$","$$")
utf8 = replace(utf8,"&#39;","'")
utf8 = replace(utf8,vbnewline,"<br/>")
end function
'==================================
'=过 程 名:
'=功    能:IP地址限制访问
'==================================
request_ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If request_ip = "" Then request_ip = Request.ServerVariables("REMOTE_ADDR")
replace_ip="|"&replace_ip
ipb = InStr(1, request_ip, ".") 
ipc = InStr(1, mid(request_ip,ipb+1), ".")
ipd = InStr(1, mid(mid(request_ip,ipb+1),ipc+1), ".")
if instr(1,replace_ip,"|" & left(request_ip,ipb) & "*") or instr(1,replace_ip,"|" & left(request_ip,ipb+ipc) & "*") or instr(1,replace_ip,"|" & left(request_ip,ipb+ipc+ipd) & "*") or instr(1,replace_ip,"|" & request_ip) then
response.write "<html><body topmargin=""80""><table width=""70%"" align=""center"" border=""0""><tr><td style=""line-height:350%;""><fieldset><legend>s o r r y !</legend>&nbsp;&nbsp;&nbsp;&nbsp;很抱歉.暂时不开通服务.<div align=""right"">"& webname &" &nbsp;&nbsp;</div></fieldset></td></tr></table></body></html>"
response.end
end if
'==================================
'=函 数 名:closedatabase
'=功    能:关闭数据库连接函数
'==================================
function closedatabase
	conn.close
	set conn = nothing
end function
'==================================
'=函 数 名:keys(str)
'=功    能:关键字过滤函数
'==================================
function keys(str)
	word=replace_word
	reword=split(word,"|")
	for i=0 to ubound(reword)
		if i=0 then
			restr=replace(str,reword(i),"<font color=red>***</font>")
		else
			restr=replace(re_1,reword(i),"<font color=red>***</font>")
		end if
		re_1=restr
	next
	keys=restr
end function
'==================================
'=功    能:后台变量设置
'=使用说明:请保留版权信息,否则后台可能会出错。
'==================================
dim waplsver,waplsstudio,waplsQQclass,waplsdemo,waplsbbs,perpage
waplsver="V1.1"
waplsstudio="『游戏天府WAP网络工作室』"
waplsweb="http://www.gotf.cn"
waplsQQclass="QQ:85222819"
waplsbbs="http://bbs.gotf.cn"
waplswap="http://wap.gotf.cn"
perpage="15" '后台分页大小

'==================================
'=函 数 名:checksql(name,str,attrib,num)
'=功    能:超强数据检测过滤函数--原创
'=使用说明:name-参数名(用于错误显示),str-参数值(用于判断),attrib-参数类型(1为字符型,0为数字型),num-参数值字符数量(字符型中0表示不限制,数字型任何情况下都有限制)
'==================================
Function checksql(name,str,attrib,num)
	dim founderr,errmsg
	founderr=false
	errmsg=""
	dim sqlname
	sqlname=name
	str=trim(str)
	'解决26个日文片假名引起显示及搜索错误的问题,替换为空
	dim F
	F=array(chr(-23116),chr(-23124),chr(-23122),chr(-23120),chr(-23118),chr(-23114),chr(-23112),chr(-23110),chr(-23099),chr(-23097),chr(-23095),chr(-23075),chr(-23079),chr(-23081),chr(-23085),chr(-23087),chr(-23052),chr(-23076),chr(-23078),chr(-23082),chr(-23084),chr(-23088),chr(-23102),chr(-23104),chr(-23106),chr(-23108))
	for i=0 to 25
		str=replace(str,F(i),"")
	next
	if attrib=1 then
		if str="<P>&nbsp;</P>" or str="<P></P>" or str="<BR>" then
			str=""
		end if
		if str="" then
			founderr=true
			errmsg=errmsg+"<br><li>"&sqlname&"不能为空!</li>"
		elseif num<>0 then
		dim Bword(22) 
				Bword(0)="--" 
				Bword(1)=",,,,,,,,,," 
				Bword(2)=">" 
				Bword(3)="<" 
				Bword(4)="chr(32)" 
				Bword(5)="’" 
				Bword(6)="””" 
				Bword(7)="chr(9)" 
				Bword(8)="$"
				Bword(9)="'" 
				Bword(10)="chr(34)" 
				Bword(11)="|"
				Bword(12)="!!!!!!!!!!"
				Bword(13)="。。。。。。。。。。"
				Bword(14)=",,,,,,,,,,"
				Bword(15)="??????????"
				Bword(16)="//////////"
				Bword(17)="、、、、、、、、、、"
				Bword(18)="\\\\\\\\\\"
				Bword(19)=""""""""""""
				Bword(20)="““““““““““"
				Bword(21)="””””””””””"
				Bword(22)="!!!!!!!!!!"
			for i= 0 to ubound(Bword) 
				if instr(str,Bword(i))<>0 then 
					founderr=true
					errmsg=errmsg+"<br><li>"&sqlname&"中含有非法字符(各种符号)!</li>"
				end if 
			next 
			if len(str)>num then
				founderr=true
				errmsg=errmsg+"<br><li>"&sqlname&"不能超过"&num&"字符!</li>"
			end if
		end if
	elseif attrib=0 then
		if str="" then
			founderr=true
			errmsg=errmsg+"<br><li>"&sqlname&"不能为空!</li>"
		elseif not isnumeric(str) then
			founderr=true
			errmsg=errmsg+"<br><li>"&sqlname&"不是数字型!</li>"
		elseif len(str)>num then
			founderr=true
			errmsg=errmsg+"<br><li>"&sqlname&"数字型参数位数不能超过"&num&"位!</li>"
		end if
	else
			founderr=true
			errmsg=errmsg+"<br><li>过滤函数调用错误!</li>"
	end if
	if founderr then
		response.redirect("")
		response.end
	end if
	checksql=str
End Function
'==================================
'=函 数 名:分页函数
'=功    能:分页
'=参数说明:totalnum为数据总条数,pagenum为config中设置的每页显示条数;filename为调用程序名;n为分页总数,其值固定;str_fenlei为分类参数,listpage为下拉表列中的参数
'==================================
function showpage(totalnum,pagenum,filename)
dim n,page,str_fenlei,listpage
m_cat=cint(request.querystring("cat_id"))
m_class=cint(request.querystring("class_id"))
if request.querystring("page")="" then
	page=1
else
	page=cint(request.querystring("page"))
end if
if m_class="" then
	m_class=0
end if
if m_cat="" then
	m_cat=0
end if
if m_class<>0 then
	str_fenlei="cat_id="&m_cat&"&class_id="&m_class&"&"
elseif m_cat<>0 then
	str_fenlei="cat_id="&m_cat&"&"
else
	str_fenlei=""
end if
if totalnum mod pagenum=0 then
	n= totalnum \ pagenum
else
	n= totalnum \ pagenum+1
end if
response.write "<table border='0' width='100%' cellspacing='0' cellpadding='4'><tr><td align='right'>"
if page<2 then
	response.write "<span class='disable_font'><font face=webdings >9</font>首页 <font face=webdings >3</font>上页</span>&nbsp;"
else
	response.write "<a href="&filename&""&str_fenlei&"page=1><font face=webdings >9</font>首页</a>&nbsp;"
	response.write "<a href="&filename&""&str_fenlei&"page="&page-1&"><font face=webdings >3</font>上页</a>&nbsp;"
end if
if n-page<1 then
	response.write "<span class='disable_font'>下页<font face=webdings >4</font> 尾页<font face=webdings >:</font></span>"
else
	response.write "<a href="&filename&""&str_fenlei&"page="&(page+1)&">"
	response.write "下页<font face=webdings>4</font></a> <a href="&filename&""&str_fenlei&"page="&n&">尾页<font face=webdings >:</font></a>"
end if
response.write "&nbsp;&nbsp;&nbsp;&nbsp;页次:<span class='current_font'>"&page&"</span>/"&n&"页"
response.write "&nbsp;&nbsp;共<span class='current_font'>"&totalnum&"</span>条&nbsp;&nbsp;<span class='current_font'>"&pagenum&"</span>条/页 "
response.write"</font></td><td align='center' width='50'><select name='page' onChange='window.location=form.page.options[form.page.selectedIndex].value'>"
listpage=1
for listpage=1 to n
	if listpage=page then
		response.write"<option value="""&filename&""&str_fenlei&"page="&listpage&""" selected>第"&listpage&"页</option>"
	else
		response.write"<option value="""&filename&""&str_fenlei&"page="&listpage&""">第"&listpage&"页</option>"
	end if
next
response.write"</select></td></form></tr></table>"
end function
'==================================
'=功    能:保存远程
'==================================
function saveimgfile(imgfileurl)
'V1.1不包含此功能
End Function
%>

⌨️ 快捷键说明

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