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

📄 savedata.asp

📁 一个很Q的留言板,下载不后悔 !功能说明: 支持cookies 支持少数UBB(颜色/URL) 支持自动超链接 支持表情(自带56个,最多可扩充到60个) 支持头像(自带8个,可
💻 ASP
字号:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--
 ========================================================================
 
                  /////popcorn3.0/////

                      copyright (c) 2004,by 521lu.com
                           all rights reserved
                    script written by h.q.
                     web site : http://www.521lu.com
                         mail : support@521lu.com

 ========================================================================
              pls don't skip the copyright annoucement
 ========================================================================
-->

<script runat=server language=vbscript>
function getupload(formdata)
    dim datastart,divstr,divlen,datasize,formfielddata
    '&#1464;&#1470;(+crlf)
    divstr = leftb(formdata,instrb(formdata,str2bin(vbcrlf)) + 1)
    '&#1464;&#1470;
    divlen = lenb(divstr)
    posopenboundary = instrb(formdata,divstr)
    poscloseboundary = instrb(posopenboundary + 1,formdata,divstr)
    set fields = createobject("scripting.dictionary")
   
    while posopenboundary > 0 and poscloseboundary > 0
       'name&#700;(name="xxxxx")6&#938;[name="]&#938;6
       fieldnamestart = instrb(posopenboundary,formdata,str2bin("name=")) + 6
       fieldnamesize = instrb(fieldnamestart,formdata,chrb(34)) - fieldnamestart '(")asc&#1461;=34
       formfieldname = bin2str(midb(formdata,fieldnamestart,fieldnamesize))
       
       'filename&#700;(filename="xxxxx")
       fieldfilenamestart = instrb(posopenboundary,formdata,str2bin("filename=")) + 10
       if fieldfilenamestart < poscloseboundary and fieldfilenamestart > posopenboundary then
          fieldfilenamesize = instrb(fieldfilenamestart,formdata,chrb(34)) - fieldfilenamestart '(")asc&#1461;=34
          formfilename = bin2str(midb(formdata,fieldfilenamestart,fieldfilenamesize))
       else
          formfilename = ""
       end if
       
       'content-type&#700;(content-type: xxxxx)
       fieldfilectstart = instrb(posopenboundary,formdata,str2bin("content-type:")) + 14
       if fieldfilectstart < poscloseboundary  and fieldfilectstart > posopenboundary then
          fieldfilectsize = instrb(fieldfilectstart,formdata,str2bin(vbcrlf & vbcrlf)) - fieldfilectstart
          formfilect = bin2str(midb(formdata,fieldfilectstart,fieldfilectsize))
       else
          formfilect = ""
       end if
       
       '&#700;&atilde;2crlf&#700;
       datastart = instrb(posopenboundary,formdata,str2bin(vbcrlf & vbcrlf)) + 4
       if formfilename <> "" then
          '&#1907;&#547;1&#938;&#316;&#308;&#545;&#1469;(appendchunk)
          '&#1469;&#938;&#892;&#1919;&#689;&#549;&#1211;&#1463;&#892;&#567;&#702;,
          '&#1469;&#938;&#380;&#316;&#882;&#10476;&#753;&#48227;&#1469;&#938;&#380;
          datasize = instrb(datastart,formdata,divstr) - datastart - 1
          formfielddata = midb(formdata,datastart,datasize)
       else
          '&#1907;&#547;2&#938;&#1464;&#1470;&#496;&#1211;crlf
          datasize = instrb(datastart,formdata,divstr) - datastart - 2
          formfielddata = bin2str(midb(formdata,datastart,datasize))
       end if

       '&#1211;dictionaryformfield
       set field = createuploadfield()
       field.name = formfieldname
       field.filepath = formfilename
       field.filename = getfilename(formfilename)
       field.contenttype = formfilect
       field.length = lenb(formfielddata)
       field.value = formfielddata
       
       fields.add formfieldname, field
       
       posopenboundary = poscloseboundary
       poscloseboundary = instrb(posopenboundary + 1,formdata,divstr)
    wend
    set getupload = fields
end function

'&#1142;&#1463;&#1514;&#872;&#1463;
function bin2str(binstr)
   dim varlen,clow,ccc,skipflag
   '&#1463;skip&#1470;
   skipflag=0
   ccc = ""
   if not isnull(binstr) then
      varlen=lenb(binstr)
      for i=1 to varlen
          if skipflag=0 then
             clow = midb(binstr,i,1)
             '&#503;&#309;&#1463;
             if ascb(clow) > 127 then
                'ascw&#1142;&#437;&#747;&#1469;&#1463;&#885;&#1514;&#1194;&#560;&#309;&#312;&#2037;&#1514;
                ccc =ccc & chr(ascw(midb(binstr,i+1,1) & clow))
                skipflag=1
             else
                ccc = ccc & chr(ascb(clow))
             end if
          else
             skipflag=0
          end if
      next
   end if
   bin2str = ccc
end function 


'&#872;&#1463;&#1514;&#630;&#1463;
function str2bin(varstr)
   str2bin=""
   for i=1 to len(varstr)
       varchar=mid(varstr,i,1)
       varasc = asc(varchar)
       ' asc&#1463;&#1461;&#938;
       ' 65536&#895;&#1975;&#1461;
       ' -1&#1723;&#702;0xffff,
       ' &#1975;&#1461;&#938;65535,65535=-1+65536
       ' &#417;
       if varasc<0 then
          varasc = varasc + 65535
       end if
       '&#309;&#308;&#55546;&#747;&#1469;&#1717;&#888;&#1471;
       if varasc>255 then
          varlow = left(hex(asc(varchar)),2)
          varhigh = right(hex(asc(varchar)),2)
          str2bin = str2bin & chrb("&h" & varlow) & chrb("&h" & varhigh)
       else
          str2bin = str2bin & chrb(ascb(varchar))
       end if
   next
end function 

'&#545;&#316;(&#549;path)
function getfilename(fullpath)
   if fullpath <> "" then
      fullpath = strreverse(fullpath)
      getfilename = strreverse(fullpath)
   else
      getfilename = ""
   end if
end function
</script>
<script runat=server language=jscript>
function createuploadfield(){ return new uf_init() }
function uf_init(){
  this.name = null
  this.filename = null
  this.filepath = null
  this.contenttype = null
  this.value = null
  this.length = null
}
</script> 
<!--#include file="config.asp"-->
<%
formsize=request.totalbytes
formdata=request.binaryread(formsize)
set fields = getupload(formdata)

name=fields("name").value
email=fields("email").value
homepage=fields("homepage").value
content=fields("content").value
face=fields("face").value
cookies=fields("cookies").value

if model="board" then
else
password=fields("password").value
end if
ip=request.servervariables("remote_addr")
nowtime=now()
dim time
time=cstr(year(nowtime))+"-"+cstr(month(nowtime))+"-"+cstr(day(nowtime))+" "+cstr(hour(nowtime))+":"+right("0"+cstr(minute(nowtime)),2)+":"+right("0"+cstr(second(nowtime)),2)
action=fields("action").value
myid=fields("myid").value
if cookies="1" then
response.cookies("h.q.")("name")=name
response.cookies("h.q.")("email")=email
response.cookies("h.q.")("home")=homepage
response.cookies("h.q.").expires=dateadd("m",8,date())
else
response.cookies("h.q.")("name")=""
response.cookies("h.q.")("email")=""
response.cookies("h.q.")("home")=""
response.cookies("h.q.").expires=dateadd("m",8,date())
end if

if model="board" then
select case action
case "add"
set rs=server.createobject("adodb.recordset") 
rs.open "select * from body where id is null",conn,1,3 
rs.addnew
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
set rs=nothing 
response.redirect "index.asp"
case "re_add"
set rs=server.createobject("adodb.recordset") 
rs.open "select * from re",conn,1,3 
rs.addnew
rs("post_id")=myid
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
rs.open "select * from body where id="&myid,conn,1,3
rs("recount")=rs("recount")+1
rs("lasttime")=now
rs.update
rs.close
set rs=nothing 
response.redirect "index.asp"
end select
else
end if

if model="diary" then
select case action
case "add"
if password=password then
set rs=server.createobject("adodb.recordset") 
rs.open "select * from body where id is null",conn,1,3 
rs.addnew
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
set rs=nothing 
response.redirect "index.asp"
else
end if
case "re_add"
set rs=server.createobject("adodb.recordset") 
rs.open "select * from re",conn,1,3 
rs.addnew
rs("post_id")=myid
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
rs.open "select * from body where id="&myid,conn,1,3
rs("recount")=rs("recount")+1
rs("lasttime")=now
rs.update
rs.close
set rs=nothing 
response.redirect "index.asp"
end select
else
end if

if model="news" then
select case action
case "add"
if password=password then
set rs=server.createobject("adodb.recordset") 
rs.open "select * from body where id is null",conn,1,3 
rs.addnew
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
set rs=nothing 
response.redirect "index.asp"
else
end if
case "re_add"
set rs=server.createobject("adodb.recordset") 
rs.open "select * from re",conn,1,3 
rs.addnew
rs("post_id")=myid
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
rs.open "select * from body where id="&myid,conn,1,3
rs("recount")=rs("recount")+1
rs("lasttime")=now
rs.update
rs.close
set rs=nothing 
response.redirect "index.asp"
end select
else
end if

if model="links" then
select case action
case "add"
if password=password then
set rs=server.createobject("adodb.recordset") 
rs.open "select * from body where id is null",conn,1,3 
rs.addnew
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
set rs=nothing 
response.redirect "index.asp"
else
end if
case "re_add"
set rs=server.createobject("adodb.recordset") 
rs.open "select * from re",conn,1,3 
rs.addnew
rs("post_id")=myid
rs("name")=name
rs("email")=email
rs("homepage")=homepage
rs("content")=content
rs("face")=face
rs("time")=time
rs("ip")=ip
rs.update 
rs.close 
rs.open "select * from body where id="&myid,conn,1,3
rs("recount")=rs("recount")+1
rs("lasttime")=now
rs.update
rs.close
set rs=nothing 
response.redirect "index.asp"
end select
else
end if

conn.close
set conn = nothing
%>

⌨️ 快捷键说明

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