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

📄 blog_msg.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="../include/datatransfer.asp"-->
<!--#include file="../include/functionjs.asp"-->
<!--#include file="../include/functionvb.asp" -->
<!--#include file="../include/dbconn.inc" -->
<!--#include file="../include/refresh.asp"-->
<!--#include file="../include/header.asp" -->
<link href="../include/main.css" rel="stylesheet" type="text/css">

<table width="710" border="1" cellpadding="2" cellspacing="0" align="center"  class="tablestyle"  bordercolor="#FFFFFF">
  <tr>
    <td  bordercolor="#4C4C4C" background="../resource/images/bbs/bg.gif" class="tablehead">&nbsp;<img src="../resource/images/blog/li.gif" width="12" height="12">&nbsp; <a href="../blog/main.asp">56Blog</a> → 发表留言</td>
  </tr>
  <tr>
    <td bordercolor="#4C4C4C">	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="200" valign="top" style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word"><%if userid=empty then %>
		<!--#include file="../include/blog_leftpub.asp"-->
		<%else%>
		<!--#include file="../include/blog_leftprv.asp"-->
		<%end if%></td>
        <td width="510" valign="top">
		<br>
<%
dim action
action=request("action")
if action="add" then
	dim pubname,msg
	pubname=trim(request.Form("pubname"))
	msg=request.Form("msg")
	msg=replace(msg,"<","&lt")
	msg=replace(msg,">","&gt")
	
	if userid="" then
		strSQL="insert into blog_msg(pub_name,msg,pubtime) values ('" &pubname &"','"&msg&"','"&now()&"')"
	else
		strSQL="insert into blog_msg(pub_name,msg,pubtime,isbloger) values ('" &username &"','"&msg&"','"&now()&"', "& 1&")"
	end if
	objConn.execute(strSQL)
		
	strSQL="select * from webcount"
	objrs.open strsql,objconn,1,3
	objrs("Blog_msgCnt")=objrs("Blog_msgCnt")+1
	objrs.update
	objrs.close	
	%>
		<table width="480" border="0" cellspacing="2" cellpadding="2" align="center" bgcolor="#D6E7FF" style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word BORDER-LEFT: #000000 1PX DASHED; BORDER-RIGHT: #000000 1PX DASHED; BORDER-TOP: #000000 1PX DASHED; BORDER-BOTTOM: #000000 1PX DASHED">
          <tr>
            <td align="center"><p>发表留言成功!
</p>
              <p>[<a href="../blog/blog_showall.asp?ShowType=4">查看所有留言</a>]</p>
              <meta http-equiv='refresh' content=1;url='javascript:history.go(-2)'></td>
          </tr>
        </table>
		<%else%>
        <table width="480" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#D6E7FF"style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word BORDER-LEFT: #000000 1PX DASHED; BORDER-RIGHT: #000000 1PX DASHED; BORDER-TOP: #000000 1PX DASHED; BORDER-BOTTOM: #000000 1PX DASHED">
          <tr>
            <td align="center">发表留言</td>
          </tr>
        </table>          
        <form name="form2" method="post" action="blog_msg.asp?action=add"  onSubmit="return checkin(this)">
            <table width="480" border="0" cellspacing="2" cellpadding="2" align="center" bgcolor="#EFEBEF" style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word BORDER-LEFT: #000000 1PX DASHED; BORDER-RIGHT: #000000 1PX DASHED; BORDER-TOP: #000000 1PX DASHED; BORDER-BOTTOM: #000000 1PX DASHED">
  				<tr>
    			<td width="80" >留名:</td>
                <td width="374"><input name="pubname" type="text" id="pubname"  size="40" <%if userid<>"" then response.Write("value='"&username&"' disabled ")%>></td>
              </tr>
              <tr>
                <td valign="top">留言:</td>
                <td><textarea  name="msg" cols=50  rows=10 wrap=VIRTUAL id="msg" ></textarea></td>
              </tr>
              <tr>
                <td colspan="2" align="center"><input type="submit" name="Submit" class="input"value="发表">
                  <input type="reset" name="reset" class="input"value="取消"></td>
                </tr>
            </table>
          </form>
		 <%end if%>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
    </table></td>
  </tr>
  <tr>
    <td bordercolor="#4C4C4C" background="../resource/images/bj2.gif" align="center">&nbsp;</td>
  </tr>
</table>

<script language="vbscript">
Function checkin(myform)
checkin=true
if (trim(myform.pubname.value)="") then
  msgbox ("请填写姓名或昵称!") 
  checkin= false
  exit function
end if

if (trim(myform.msg.value)="") then
  msgbox ("请填写留言内容!!") 
  checkin= false
  exit function
end if
end Function
</script>

<!--#include file="../include/endconn.inc" -->
<!--#include file="../include/footer.asp" -->

⌨️ 快捷键说明

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