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

📄 function.asp

📁 找北文章系统
💻 ASP
字号:
<%
'-------------------------------
'编辑过程
'-------------------------------
function editok(str)
id=request("id")
if str=1 then
set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from art where id="&id
rs.open rsstr,conn,1,3
response.write("编辑"&rs("title")&"<form id=""form1"" name=""form1"" method=""post"" action=""edit.asp?id="&id&"&amp;xy="&xy&"""><br/>标题(必填):<br/><input name=""title"" title=""标题"" emptyok=""true"" value="""&rs("title")&"""/><br/>内容(必填):<br/><input name=""text"" title=""内容"" emptyok=""true"" value="""&rs("text")&"""/><br/>是否上传图片(说明:如没有或从新上传则选)<br/><select title=""上传"" name=""pic"" value=""""><option title=""不上传"" value=""2"">不上传</option><option title=""上传"" value=""1"">上传</option></select><br/>是否有答案?<br/>(说明:如果你的是迷语,破案等互动文章,需要写答案,则选取此顶):<br/><select title=""答案"" name=""an"" value=""><option title=""没有"" value="""">没有</option><option title=""有"" value=""1"">有</option></select><br/>答案(选填,如果你选了是,则填写):<br/><input name=""anan"" title=""答案"" value="""&rs("anan")&"""/><br/><br/>分类:<select title=""分类"" name=""classid"" value=""""><option title=""请选择"" value="""">请选择</option>")
set rst=server.createobject("ADODB.Recordset")
Sql="select * from class order by ClassID asc"
rst.open Sql,conn,1,1
i=1
do while not rst.eof
response.write("<option title="""&rst("ClassName")&""" value="""&rst("id")&""">"&i&"."&rst("ClassName")&"</option>")
i=i+1
rst.movenext
loop
rst.Close
set rst=nothing
response.write("</select><br/><input type=""submit"" name=""Submit"" value=""提交"" /></form><br/><a href=""index.asp?xy="&xy&""">[管理中心]</a><br/>")
response.end
end if
end function



'-------------------------------
'结束处理
'-------------------------------
function fa
	response.Flush()
end function


'-------------------------------
'上传处理
'-------------------------------
function upup(str)
if str=1 then
response.write("因为你选择了上传图片,请上传<br/>")
response.write("<form action='upup.asp?xy="&xy&"&amp;id="&id&"' enctype='multipart/form-data' method='post'>文件:<input name='file' type='file' title='选择文件' size='10'><br/><input type='submit' name='submit' value='提交' emptyok='true'/>")
end if
end function



'-------------------------------
'处理字符串1
'-------------------------------
function checkstr(str)
	if IsNull(str) then exit function
	str=trim(str)
	str=replace(str,"&","&amp;")
	str=replace(str,"<","&lt;")
	str=replace(str,">","&gt;")
	str=replace(str,"'","&apos;")
	str=replace(str,"""","&quot;")
	str=replace(str,"$","$$")
	str=replace(str,"&nbsp;","")
        str=replace(str,Chr(13),"<br/>")
	checkstr=str
end function



'-------------------------------
'处理字符串2
'-------------------------------
function check(str)
	str=trim(str)
	if IsNull(str) then exit function
	str=replace(str,"&","&amp;")
	str=replace(str,"<","&lt;")
	str=replace(str,">","&gt;")
	str=replace(str,"'","&apos;")
	str=replace(str,"""","&quot;")
	str=replace(str,"$","$$")
	str=replace(str,"&nbsp;","")
        str=replace(str,Chr(13),"<br/>")
        str=replace(str,"淫","?")
        str=replace(str,"操","?")
        str=replace(str,"法轮功","?")
        str=replace(str,"他妈的","?")
	check=str
end function


'-------------------------------
'随机过程
'-------------------------------
function sjsj(str)
a=1
Do While a<=str
set rs=server.createobject("ADODB.Recordset")
Sql="select id,title,hot from art where pass"
rs.open Sql,conn,1,1
randomize
sjj=int(rnd()*rs.recordcount)+1
rs.absoluteposition=sjj
response.write "<a href='read.asp?id="&rs("id")&"&amp;p=1'>"&rs("title")&"</a> 点击:"&rs("hot")&"<br/>"
rs.close
set rs=nothing
a=a+1
Loop
end function


'-------------------------------
'分类过程
'-------------------------------
function fenlei(str)
set cn1=server.createobject("adodb.recordset")
cn1.open "select id,classname,brr from class order by ClassID asc",conn,1,1
do while(not cn1.eof)
	response.write("<a href=""list.asp?id="&cn1("id")&""">"&cn1("ClassName")&"</a>")
	if cn1("brr")=true then
		response.write("<br/>")
	else
		response.write(""&str&"") '在这里设置分隔符
	end if
	cn1.movenext
loop
cn1.close
set cn1=nothing
end function
%>

⌨️ 快捷键说明

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