www.gusucode.com > 维六酷博客管理系统 1.1源码程序 > book.asp

    <!-- #include file="conn.asp" -->
<!--#include file="include.asp"-->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/char.inc" -->
<%
action=RequestFormStr("action")
If action="save" Then
	Call save()
End If
Sub save()
	dim bookname
	dim bookwhere
	dim bookpic
	dim bookface
	dim bookcontent
	dim booktime
	dim bookip
	dim rs
	dim sql
	dim FoundErr,ErrMsg
	dim strArr,i,BookFilter,BookExamine

	bookname=RequestFormStr("name")
	bookwhere=RequestFormStr("where")
	bookpic=RequestFormStr("pic")
	bookshow=RequestFormNum("show")
	bookcontent=RequestFormStr("content")
	bookip=request.ServerVariables("REMOTE_ADDR")
	codes=RequestFormNum("codes")

	if bookname="" then
		Call MessageBox("留言昵称不能为空!","")
		Response.End
	end if
	if bookcontent="" then
		Call MessageBox("留言内容不能为空!","")
		Response.End
	end If
	If codes <> session("codes") Then
		Call MessageBox("验证码不正确!","")
		Response.End
	End If
	strArr=split(W_BookWorryNeed,"|")  
	for i=0 to ubound(strArr)
	   bookname=replace(bookname,strArr(i),"请您文明用语")
	next

	for i=0 to ubound(strArr)
	   booktitle=replace(booktitle,strArr(i),"请您文明用语")
	next

	for i=0 to ubound(strArr)
	   bookcontent=replace(bookcontent,strArr(i),"请您文明用语")
	next


	set rs=Server.CreateObject("ADODB.Recordset")
	sql="select * from book"
	rs.open sql,conn,1,3
	rs.addnew
		rs("name")=htmlencode(bookname)
		rs("where")=htmlencode(bookwhere)
		rs("pic")=bookpic
		rs("face")="../Imgs/icons/"&bookface&".gif"
		rs("show")=bookshow
		rs("content")=htmlencode(bookcontent)
		rs("ip")=bookip
		rs("time")=now()
	rs.update
	rs.close
	Set rs=nothing
	session("codes")=""
	Call MessageBox("留言成功!","book.asp?action=1")
End Sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>让我更出色_留言版</title>
<style type="text/css">
<!--
body {
	background-color: #000000;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
}

.STYLE3 {
	color: #abe300;
	font-weight: bold;
}
.STYLE4 {color: #999999}
.STYLE5 {
	color: #FFFFFF;
	font-weight: bold;
}
.STYLE6 {
	color: #ABE300;
	font-weight: bold;
}
.cssCopy {
	background-color: #333333;
	border: 1px solid #000000;
	color:#FFFFFF;
}
-->
</style>
<link href="css/css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="right"><img src="images/aboutme_r1_c6.jpg" width="276" height="55" border="0" usemap="#Map2"><map name="Map2"><area shape="rect" coords="144,26,211,43" href="default.asp"><area shape="rect" coords="212,26,266,42" href="link.asp"></td>
  </tr>
  <tr>
    <td align="right"><table width="100%" height="294" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top">
          <table width="82%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="33%" height="50" align="left"><img src="images/book_r1_c2.jpg" width="126" height="39"></td>
            <td width="13%" align="left"><a href="book.asp"><img src="images/book_r2_c4.jpg" width="96" height="34" border="0"></a></td>
            <td width="54%" align="left"><a href="book.asp?action=1"><img src="images/book_r2_c5.jpg" width="104" height="34" border="0"></a></td>
          </tr>
        </table>
		<!---->
	<%
	If RequestQueryNum("action")=1 Then
		Call show()
	Else
		Call add()
	End If
	Sub add()
		If isBook=False Then
			Response.Write "<center>留言功能已经关闭!</center>"
		Else
			Dim MyValue
			Randomize 
			MyValue = Int((9999 - 1000 + 1) * Rnd + 1000)
			session("codes")=MyValue
%>
          <table width="82%" height="198" border="0" align="center" cellpadding="0" cellspacing="0">
		  <form action="book.asp" method="post" name="form" id="form" >
		  <input type="hidden" name="action" value="save">
            <tr>
              <td align="right" width="100">留言昵称:</td>
			  <td align="left">&nbsp;<input name="name" type="text" class="css" size="10" maxlength="10"></td>
            </tr>
            <tr>
              <td align="right">来自哪里:</td>
			  <td align="left"><table><tr><td>&nbsp;<select name="select" class="css">
                   <option value="未知" selected="selected">未知</option>
                   <option value="北京">北京</option>
                   <option value="上海">上海</option>
                   <option value="天津">天津</option>
                   <option value="重庆">重庆</option>
                   <option value="河北">河北</option>
                   <option value="山西">山西</option>
                   <option value="内蒙古">内蒙古</option>
                   <option value="辽宁">辽宁</option>
                   <option value="吉林">吉林</option>
                   <option value="黑龙江">黑龙江</option>
                   <option value="江苏">江苏</option>
                   <option value="浙江">浙江</option>
                   <option value="安徽">安徽</option>
                   <option value="福建">福建</option>
                   <option value="江西">江西</option>
                   <option value="山东">山东</option>
                   <option value="河南">河南</option>
                   <option value="湖北">湖北</option>
                   <option value="湖南">湖南</option>
                   <option value="广东">广东</option>
                   <option value="广西">广西</option>
                   <option value="海南">海南</option>
                   <option value="四川">四川</option>
                   <option value="贵州">贵州</option>
                   <option value="云南">云南</option>
                   <option value="西藏">西藏</option>
                   <option value="陕西">陕西</option>
                   <option value="甘肃">甘肃</option>
                   <option value="宁夏">宁夏</option>
                   <option value="青海">青海</option>
                   <option value="新疆">新疆</option>
                   <option value="香港">香港</option>
                   <option value="澳门">澳门</option>
                   <option value="台湾">台湾</option>
                   <option value="海外">海外</option>
                  </select>
                &nbsp;&nbsp;&nbsp;选择头像:<select name="pic" class="css" onchange="document.images ['iface'].src=options[selectedIndex].value;//backwav.src='facechange.wav';" size="1" style="border: 1px solid #E6E6E6">
                   <option value="Imgs/face/1.gif" selected="selected">NO.01</option>
                   <%for i=2 to 21%>
                   <option value="Imgs/face/<%=i%>.gif">NO.
                     <%if i<10 then
					response.write "0"&i
					else response.write i
					end if
					%>
                     </option>
                   <%next%>
                 </select><td><img src="Imgs/face/1.gif" name="iface" width="40" height="40" id="iface" /></td></tr></table></td>
            </tr>
            <tr>
              <td align="right">留言性质:</td>
			  <td align="left">&nbsp;<input type="radio" name="show" value="1" checked="true">
                公开
                <input type="radio" name="show" value="2">
                悄悄话 </td>
            </tr>
            <tr>
              <td align="right">留言内容:</td>
			  <td align="left">&nbsp;<textarea name="content" cols="40" rows="5" class="cssCopy"></textarea></td>
            </tr>
            <tr>
              <td  align="right">验证码: </td>
			  <td align="left">&nbsp;<input name="codes" type="text" class="css" size="4" maxlength="4">&nbsp;<span class="red"><%=myvalue%></span></td>
            </tr>
            <tr>
				<td >&nbsp;</td>
              <td align="left">&nbsp;<input name="submit" type="submit" value="发表留言" class="css" size="10"></td>
            </tr>
			</form>
          </table>
		  <%
		  End If
		 End Sub
		  %>
		  <!---->
          </td>
        <td width="38%"><img src="images/book_r2_c9.jpg" width="386" height="267"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr><td height="8"></td></tr>
      <tr>
        <td width="44%" rowspan="3" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="67%"><img src="images/book_r7_c1.jpg" width="292" height="143"></td>
            <td width="33%" rowspan="2"><img src="images/book_r7_c5.jpg" width="145" height="256"></td>
          </tr>
          <tr>
            <td><img src="images/book_r8_c1.jpg" width="292" height="113"></td>
            </tr>
        </table></td>
        <td width="56%"><img src="images/Articlemuen.jpg" width="563" height="60" border="0" usemap="#Map"></td>
      </tr>
      <tr>
        <td><img src="images/aboutme2_r1_c1.jpg" width="563" height="93"></td>
      </tr>
      <tr>
        <td><img src="images/aboutme2_r3_c1.jpg" width="563" height="103"></td>
      </tr>
    </table></td>
  </tr>
</table>

<map name="Map">
<area shape="rect" coords="7,19,74,53" href="aboutme.asp">
<area shape="rect" coords="84,22,141,49" href="Article.asp">
<area shape="rect" coords="156,18,219,46" href="Multimedia.asp">
<area shape="rect" coords="228,22,290,49" href="photo.asp">
<area shape="rect" coords="309,32,378,54" href="tool.asp">
<area shape="rect" coords="384,23,461,52" href="book.asp">
</map></body>
</html>
<%
Sub show()
%>
	<IFRAME  src="bookframe.asp" frameborder="0" scrolling="YES" width="600" height="228"></IFRAME>
<%
End Sub
%>