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

📄 message.asp

📁 内无病毒,请放心下载,有不足之出请提出,
💻 ASP
字号:
<!--#include file=blogdata.asp-->
<!--#include file=function.asp-->
<!--#include file=top.asp-->
<html>
<body>
<title>留言</title>
<LINK href="images/lx.css" type=text/css rel=stylesheet>
<div align="center">
	<div align="center">
<%
Const MaxPerPage=10
dim totalPut   
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request.QueryString("page")) then
currentPage=Cint(request.QueryString("page"))
else
currentPage=1
end if 		
Set rs=Server.CreateObject("ADODB.RecordSet") 
sql="select * from message order by id desc" 
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂无留言")
else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"Message.asp"
       				else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move  (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"Message.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"Message.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
 <table border="1" cellpadding="0" width="743" height="67" id="table2" style="border-collapse: collapse" bordercolor="#8CACBB">
			<tr>
				<td valign="middle" height="23" width="678" bgcolor="#DEE7EC">
				网名:<%=rs("name")%>&nbsp;&nbsp;QQ:<%=rs("qq")%>&nbsp;&nbsp;E-Mail:<%=rs("email")%>&nbsp;&nbsp;发表时间:<%if rs("time")=date() then%>
<%=year(rs("time"))%>-<%=month(rs("time"))%>- <%=day(rs("time"))%>
<%else%>
<%=year(rs("time"))%>-<%=month(rs("time"))%>-<%=day(rs("time"))%>
<%end if%></td>
				<td valign="middle" height="23" width="59" bgcolor="#DEE7EC">
				<p align="center"><a href="admin.asp?message=del&id=<%=rs("id")%>">删除</a></td>
			</tr>
			<tr>
				<td valign="top" height="45" width="741" colspan="2">
				<div align="center">
					<table cellpadding="0" cellspacing="0" width="719" height="43">
						<tr>
							<td height="43" valign="top"><%=rs("cont")%></td>
						</tr>
					</table>
				</div>
				</td>
			</tr>
		</table>
		</td>
		    <%
		rs.movenext
				 loop
		 rs.close
		 set rs=nothing%>
          </tr>
          <tr>
            <td><div align="center"><span class="style11 style2">
              <%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If
				
				Response.Write "<p align='center' class='style11'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='style11'><font color=#333333> 首 页 上一页</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1 class='style11'><font color=#333333> 首 页</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&" class='style11'><font color=#333333> 上一页</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='style11'>下一页 末 页</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='style11'>"  
					Response.Write "<font color=#333333> 下一页</font> </a> <a href="&filename&"?page="&n&" class='style11'><font color=#333333> 末 页</font> </a>"  
				End If  
					Response.Write "<font color=#333333> 页次:</font><font color=#333333> "&CurrentPage&"</font><font color=#333333> /"&n&"页</font> "  
					Response.Write "<font color=#333333>  共有"&totalnumber&"个信息 " 
				End Function  
			%>
            </span></div></td>

		<p> </div>
	<table border="0" cellpadding="0" cellspacing="0" width="74%" height="157">
		<tr>
			<td valign="top" height="157" width="745">
			<table cellSpacing="1" cellPadding="1" width="100%" border="0" id="table1">
				<form name="go" method="post" action="message.asp?message=ok">
					<tr>
						<td>网名: <input id="username" size="10" name="name" maxlength="6"> QQ:<input id="chkcode" style="COLOR: #369" size="10" name="qq" maxlength="9">&nbsp;E-Mail:<input id="username0" size="10" name="email" maxlength="20"></td>
					</tr>
					<tr>
						<td>留言内容:(祝列锋请你文明用语)</td>
					</tr>
					<tr>
						<td>
						<textarea id="content" style="width: 596; height: 100" name="cont" rows="4" cols="75"></textarea>
						<input onClick="sendForm(this.form);" type="submit" value="发 布" name="go"></td>
					</tr>
				</form>
			</table>
 </td>
		</tr>
	</table>
</div>
<!--#include file="Bottom.asp"-->
</body>
</html>
<%
if request("message")="ok" then
function changechr(str) 
changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") 
changechr=replace(replace(replace(replace(changechr,"[owen]","<img src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=5>") 
changechr=replace(replace(replace(replace(changechr,"[/owen]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>") 
end function
if request.form("name")="" then
response.write"<script language=javascript>alert('姓名不能为空!');location.href='Message.asp';</script>"
response.end
end if
if request.form("qq")="" then
response.write"<script language=javascript>alert('QQ不能为空');location.href='Message.asp';</script>"
response.end
end if
if request.form("email")="" then
response.write"<script language=javascript>alert('E-Mail不能为空');location.href='Message.asp';</script>"
response.end
end if
if request.form("cont")="" then
response.write"<script language=javascript>alert('留言内容不能为空');location.href='Message.asp';</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from message" ,conn,1,3
    rs.addnew
	rs("name")=changechr(request.form("name"))
	rs("qq")=changechr(request.form("qq"))
	rs("email")=changechr(request.form("email"))
	rs("cont")=changechr(request.form("cont"))
    rs("time")=now()
    rs.update
    rs.close
    set rs=nothing
    response.write "<script language=javascript>alert('成功留言');location.href='Message.asp';</script> "
    response.End 
	end if
%>

⌨️ 快捷键说明

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