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

📄 guestbook.asp

📁 一个有用的东西 希望大家喜欢 谢谢大家对本站的支持
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="mfk_body.asp"-->
<!--#include file="system/ubb.asp"-->
<html>
<head>
<title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.hh {
	cursor: hand;
}
-->
</style>
</head>
<body>
<script>
function mfk(){
if(form1.t1.value==""){
alert("请填写姓名!");
form1.t1.focus();
return false;
}
if(form1.t4.value==""){
alert("请填写留言内容!");
form1.t4.focus();
return false;
}
if(form1.t1.value.length>10){
alert("姓名的字数不能大于10");
form1.t1.focus();
return false;
}
if(form1.t2.value.length>50){
alert("邮件的字数不能大于50");
form1.t2.focus();
return false;
}
if(form1.t3.value.length>50){
alert("主页的字数不能大于50");
form1.t3.focus();
return false;
}
}
function addmfk(str){
	form1.t4.value+=str;
	form1.t4.focus;
}
function opennew(url,hh,ww){
properties  = "width=" + ww;
properties += ",height=" + hh;
properties += ",scrollbars=0,toolbar=0,location=0";
properties += ",directories=0,status=0,menubar=0";
properties += ",resizable=0,left=200,top=100";
window.open (url,null,properties);
}
</script>
<%
function face(tt)
tt=replace(tt,"[mfk1]"," <img src=mfk-face/1.gif> ")
tt=replace(tt,"[mfk2]"," <img src=mfk-face/2.gif> ")
tt=replace(tt,"[mfk3]"," <img src=mfk-face/3.gif> ")
tt=replace(tt,"[mfk4]"," <img src=mfk-face/4.gif> ")
tt=replace(tt,"[mfk5]"," <img src=mfk-face/5.gif> ")
tt=replace(tt,"[mfk6]"," <img src=mfk-face/6.gif> ")
tt=replace(tt,"[mfk7]"," <img src=mfk-face/7.gif> ")
tt=replace(tt,"[mfk8]"," <img src=mfk-face/8.gif> ")
tt=replace(tt,"[mfk9]"," <img src=mfk-face/9.gif> ")
tt=replace(tt,"[mfk10]"," <img src=mfk-face/10.gif> ")
tt=replace(tt,"[mfk11]"," <img src=mfk-face/11.gif> ")
tt=replace(tt,"[mfk12]"," <img src=mfk-face/12.gif> ")
tt=replace(tt,"[mfk13]"," <img src=mfk-face/13.gif> ")
tt=replace(tt,"[mfk14]"," <img src=mfk-face/14.gif> ")
tt=replace(tt,"[mfk15]"," <img src=mfk-face/15.gif> ")
tt=replace(tt,"[mfk16]"," <img src=mfk-face/16.gif> ")
tt=replace(tt,"[mfk17]"," <img src=mfk-face/17.gif> ")
tt=replace(tt,"[mfk18]"," <img src=mfk-face/18.gif> ")
tt=replace(tt,"[mfk19]"," <img src=mfk-face/19.gif> ")
face=tt
end function
dim page
page=request("page")
if page="" then
page=1
end if
if session("admin")="mfkiqpl" then
admin=true
end if
sub addly()
dim t1,t2,t3,t4,t5
t1=replace(request("t1"),"'","’")
t2=replace(request("t2"),"'","’")
t3=replace(request("t2"),"'","’")
t3=replace(request("t3"),"'","’")
t4=replace(request("t4"),"'","’")
t5=now()
if t1<>"" and t4<>"" then
sql="insert into guestbook(uname,uemail,uhomepage,utext,utime)values('"&t1&"','"&t2&"','"&t3&"','"&t4&"','"&t5&"')"
conn.execute (sql)
response.Redirect("guestbook.asp")
end if
end sub
dim action
action=request("action")
if action="ok" then
addly
end if
call pagestart%>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="27"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle1.gif"></td>
    <td width="701" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle1.gif">&nbsp;</td>
    <td width="27"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle1.gif"></td>
  </tr>
</table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="1" class="lefttablebox">  
  <tr><td height="28"><table width="750" border="0" cellspacing="0" cellpadding="0">
 <tr>   <td width="30" align="center">&nbsp;</td>   
 <td width="565">签 写 留 言</td>   
 <td width="77" class="hh"></td>
   <td width="78" class="hh"><a onclick="opennew('help.asp','200','200');" title="帮助">UBB代码帮助</a></td>
 </tr></table></td>  
  </tr>  <tr><td height="173" class="titletable"><table width="750" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="28" colspan="3"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0"><tr>
  <td width="130" align="center">选择插入心情图标:</td>
  <td width="30" align="center"><img src="mfk-face/1.gif" alt="[mfk1]" width="19" height="19" class="hh" onclick="addmfk('[mfk1]')"></td>
  <td width="30" align="center"><img src="mfk-face/2.gif" alt="[mfk2]" width="19" height="19" onclick="addmfk('[mfk2]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/3.gif" alt="[mfk3]" width="19" height="19" onclick="addmfk('[mfk3]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/4.gif" alt="[mfk4]" width="19" height="19" onclick="addmfk('[mfk4]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/5.gif" alt="[mfk5]" width="19" height="19" onclick="addmfk('[mfk5]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/6.gif" alt="[mfk6]" width="19" height="19" onclick="addmfk('[mfk6]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/7.gif" alt="[mfk7]" width="19" height="19" onclick="addmfk('[mfk7]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/8.gif" alt="[mfk8]" width="19" height="19" onclick="addmfk('[mfk8]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/9.gif" alt="[mfk9]" width="19" height="19" onclick="addmfk('[mfk9]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/10.gif" alt="[mfk10]" width="19" height="19" onclick="addmfk('[mfk10]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/11.gif" alt="[mfk11]" width="19" height="19" onclick="addmfk('[mfk11]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/12.gif" alt="[mfk12]" width="19" height="19" onclick="addmfk('[mfk12]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/13.gif" alt="[mfk13]" width="19" height="19" onclick="addmfk('[mfk13]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/14.gif" alt="[mfk14]" width="19" height="19" onclick="addmfk('[mfk14]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/15.gif" alt="[mfk15]" width="19" height="19" onclick="addmfk('[mfk15]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/16.gif" alt="[mfk16]" width="19" height="19" onclick="addmfk('[mfk16]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/17.gif" alt="[mfk17]" width="19" height="19" onclick="addmfk('[mfk17]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/18.gif" alt="[mfk18]" width="19" height="19" onclick="addmfk('[mfk18]')" class="hh"></td>
  <td width="30" align="center"><img src="mfk-face/19.gif" alt="[mfk19]" width="19" height="19" onclick="addmfk('[mfk19]')" class="hh"></td>
</tr>   </table></td>   </tr><form name="form1" method="post" action="guestbook.asp?action=ok" onSubmit="return mfk();"> <tr>   <td width="86" height="30" align="center"> 姓名:</td>   <td width="181" height="30"><input name="t1" type="text" id="t1" maxlength="50" value="<%=session("user")%>" onMouseOver="this.focus();"></td>   <td width="483" rowspan="3"><textarea name="t4" cols="60" rows="6" id="t4" onMouseOver="this.focus();"></textarea></td> </tr> <tr>   <td height="30" align="center">邮件:</td>   <td height="30"><input name="t2" type="text" id="t2" maxlength="50" onMouseOver="this.focus();"></td>   </tr> <tr><td height="30" align="center">主页:</td><td height="30"><input name="t3" type="text" id="t3" value="http://" maxlength="50" onMouseOver="this.focus();"></td>
</tr><tr><td height="30" colspan="3" align="center"><input name="Submit" type="submit" class="mfk_button" value="确定留言">      
<input name="Submit2" type="reset" class="mfk_button" value="清除重写"></td></tr></form></table></td></tr></table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="7"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle1_1.gif"></td>
    <td width="741" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle1_1.gif">&nbsp;</td>
    <td width="7"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle1_1.gif"></td>
  </tr>
</table>
<%
set rsl=server.createobject("adodb.recordset")
set rsl.activeconnection=conn
lis="select * from [guestbook] order by id desc"
rsl.open lis,,1,2
if (rsl.bof and rsl.eof) then
response.write("<table width=755 border=0 align=center cellpadding=0 cellspacing=1><tr><td height=20 align=center>暂时还没有人留言,您不想说几句吗?</td></tr></table>")
else
i=0
rsl.pagesize=10'设置每页显示记录数
page=trim(request("page"))
if page<>"" then
page=cint(page)
else
page=1
end if
pagec=rsl.pagecount
if page>pagec then
page=pagec
end if
rsl.absolutepage=page
a=0
while not rsl.eof and a<rsl.pagesize
%>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">  
  <tr><td>
  <table width="755" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="29"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle.gif"></td>
      <td width="693" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle.gif"><table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="400"> <strong><%=mfkiqpl(rsl("uname"))%></strong> 在 <strong><%=rsl("utime")%></strong> 说:</td>
          <td width="72" align="center"><a href="mailto:<%=rsl("uemail")%>"><img src="images/email.gif" alt="给<%=mfkiqpl(rsl("uname"))%>发邮件" width="42" height="16" border="0"></a></td>
          <td width="72" align="center"><a href="<%=mfkiqpl(rsl("uhomepage"))%>" target="_blank"><img src="images/homepage.gif" alt="查看<%=mfkiqpl(rsl("uname"))%>的主页" width="42" height="16" border="0"></a></td>
          <td width="72" align="center"><%if admin=true then%>
              <a href="javascript:opennew('reguestbook.asp?id=<%=rsl("id")%>','200','400')"><img src="images/edit.gif" alt="回复" width="42" height="16" border="0"></a>
              <%else%>
              <img src="images/edit.gif" alt="回复" width="42" height="16">
              <%end if%></td>
          <td width="75" align="center"><%if admin=true then%>
              <a href="javascript:opennew('delguestbook.asp?id=<%=rsl("id")%>','1','1')"><img src="images/del.gif" alt="删除" width="42" height="16" border="0"></a>
              <%else
response.write("<img src=""images/del.gif"" alt=""删除"" width=""42"" height=""16"">")
end if
%>
          </td>
        </tr>
      </table></td>
      <td width="31"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle.gif"></td>
    </tr>
  </table></td>  
</tr>  <tr><td><table width="749" border="0" align="center" cellpadding="5" cellspacing="0" class="tablebox1">
<tr><td height="36" style="word-break:break-all"><span class="text"><%=face(ubbcode(rsl("utext")))%></span></td> </tr></table>
<%
if rsl("re").value<>"" then
%>
<table width=749 border=0 align=center cellpadding=0 cellspacing=0 class=tablebox1>
  <tr><td height=40 class="text">    <img src=images/rr1.gif width=10 height=12>版主回复:<br>  
<%=face(ubbcode(rsl("re")))%>
</td></tr> </table>
<%
end if
%>
</td></tr></table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="4"></td>
  </tr>
</table>
<%
rsl.movenext
a=a+1
wend
%>
<table width='755' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='5'></td>
  </tr>
</table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="29"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle.gif"></td>
    <td width="695" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle.gif"><%
response.write("共有留言:"&rsl.recordcount&" 每页显示:"&rsl.pagesize&" 页数:"&rsl.pagecount&" ")
		response.write ("<a href=?page=1>首页</a> ")
		if page>1 then
		response.write ("<a href=?page="&page-1&">上一页</a> ")
		else
		response.write("上一页 ")
		end if
		if page<pagec then
		response.write("<a href=?page="&page+1&">下一页</a> ")
		else
		response.write("下一页 ")
		end if
		response.write ("<a href=?page="&pagec&">尾页</a> ")
		response.write ("当前:"&page&"/"&pagec&"")
%></td>
    <td width="31"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle.gif"></td>
  </tr>
</table>
<%
rsl.close
set rsl=nothing
end if
%>
<table width='755' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td height='5'></td></tr></table>
<%
call pageend
%>

⌨️ 快捷键说明

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