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

📄 bulletin.asp

📁 ASP编写的网站
💻 ASP
字号:
<% Option Explicit %>
<%response.buffer=true%>
<!--#include file="Inc_common.asp"-->
<%
'**************************************
'**    Bulletin.asp
'**
'** 文件说明:公告发布页面
'** 修改日期:2004-11-12
'** 作者:HACKer007
'** Email:panyisi5201314@tom.com
'**************************************

if not session("login")="true" then
  errinfo="<li>您未登陆或已经退出登陆,不能进入该页。"
  call error()
end if


dim mainpic
mainpic="page_bulletin.gif"

select case request("act")
  case "addnew"
  call addnew()
  case else
  call main()
end select

sub main()
  pagename="发布公告"
  call pageinfo()
  
  call skin1()
'---------------以下显示页面主体--------
%><br>
<script src="ubb.js"></script>
</p>
<form action="?act=addnew" method="POST" name="frmAnnounce">
  <table align="center" cellpadding="3" cellspacing="1" class="table1" width="95%" style="border-collapse: collapse table-layoutfixed; word-break: break-all">
    <tr>
      <td width="20%" class="tablebody3" align="right" height="19">管理QQ</td>
      <td width="80%" class="tablebody2" height="19">
      <input name="userqq" size="19" maxlength="80"></td>
    </tr>
    <tr>
      <td width="20%" class="tablebody3" align="right" height="19">
      <font FACE="宋体" COLOR="red">**</font> <b>公告标题</b></td>
      <td width="80%" class="tablebody2" height="19">
      <input name="usertitle" size="40" maxlength="100"></td>
    </tr>
    <tr>
      <td width="20%" valign="top" class="tablebody3" align="right" height="160">
      <font FACE="宋体" COLOR="red">**</font> <b>公告正文</b></td>
      <td width="80%" class="tablebody2" height="160">
      <!--#include file="Inc_ubb.asp"-->
      <textarea class="smallarea" cols="60" name="usercontent" title="Ctrl+Enter提交" rows="12" onkeydown="ctlent()"></textarea><br>
      <br>
      点击表情符号可以将其加入正文(正文内容不能大于300字符)。<br>
      <%
dim ii,i
for i=1 to 42
  if len(i)=1 then ii="0" & i else ii=i
  response.write "<img src=""images/faces/"&ii&".gif"" border=0 onclick=""insertsmilie('[face"&ii&"]')"" style=""CURSOR: hand"">&nbsp;"
  if i=17 or i=34 then response.write "<br>"
next
%> </td>
    </tr>
    <tr>
      <td valign="middle" colspan="2" align="center" class="tablebody1" height="21">
      <input type="Submit" name="Submit" value="提 交">&nbsp;&nbsp;
      <input type="reset" name="Submit2" value="清 除">&nbsp;&nbsp;
      <input type="button" name="Preview" value="预览" onclick="openpreview()">
      </td>
    </tr>
  </table>
  </div>
</form>
<form name="preview" action="Preview.asp" method="post" target="preview_page">
  <input type="hidden" name="usertitle" value>
  <input type="hidden" name="usercontent" value>
</form>
<%
'--------------页面主体显示结束--------
  call skin2()
end sub

sub addnew()

  if not session("login")="true" then
    errinfo="<li>您未登陆或已经退出登陆,不能进入该页。"
    call error()
  else

  dim username,userurl,usermail,userqq,usertitle,usercontent

    userqq=filter(Trim(request.form("userqq")))
    usertitle=filter(Trim(request.form("usertitle")))
    usercontent=filter(Rtrim(request.form("usercontent")))

  if usertitle="" then
    errinfo=errinfo & "<li>未填写标题"
    elseif len(usertitle)>50 then
    errinfo=errinfo & "<li>过长的标题"
  end if

  if usercontent="" then
    errinfo=errinfo & "<li>未填写留言内容"
  end if

  if trim(userqq)<>"" then
    if not(isnumeric(userqq)) then
      errinfo=errinfo & "<li>QQ号码填写有误"
    end if
  end if

call error()

  Set rs= Server.CreateObject("ADODB.Recordset")
  sql="select * from topic"
  rs.open sql,conn,3,2
  rs.addnew
  rs("username")=name
  rs("xingbie")=0
  rs("userurl")=url
  rs("usermail")=adminmail
  rs("userqq")=userqq
  rs("usertime")=now()
  rs("usertitle")=usertitle
  rs("usercontent")=usercontent
  rs("top")="1"
  rs("reply")="0"
  rs("ip")=ip
  rs("checked")=1
  rs("whisper")=0
  rs.update
  rs.close
  Response.Redirect "Index.asp"
  Response.Flush

end if
end sub
%>

⌨️ 快捷键说明

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