<!-- #include file="header.asp" -->
<!-- #include file="include/function.asp" -->
<script language="JavaScript" src="include/ubbcode.js"></script>
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language='JavaScript'> initToolTips(); </script>
<%
	on error resume next
	dim WrForm(10),iyzcode,From_url,Serv_url,facelist_rs
	
	'WrForm(0)=name
	'WrForm(1)=qq
	'WrForm(2)=homeurl
	'WrForm(3)=mail
	'WrForm(4)=content
	'WrForm(5)=face
	'WrForm(6)=time
	'WrForm(7)=ip
	'WrForm(8)=show
	'WrForm(9)=from
	if CheckStr(request("action")) = "new" then
		From_url = Cstr(Request.ServerVariables("HTTP_REFERER"))
		Serv_url = Cstr(Request.ServerVariables("SERVER_NAME"))
			if mid(From_url,8,len(Serv_url)) <> Serv_url then
				session("imsg") = "13"
				response.redirect ("msg.asp")
				response.end
			end if

		iyzcode = cint(trim(request("yzcode")))
			if iyzcode <> cint(Session("GetCodebbs")) then
				session("imsg") = "14"
				response.redirect("msg.asp")
				response.end
			end if
		WrForm(0) = CheckStr(trim(request("name")))
		WrForm(1) = CheckStr(trim(request("qq")))
			if  CheckStr(HTMLEncode(trim(request("homeurl")))) = "" then
				WrForm(2) = "http://"
			else
				WrForm(2) = CheckStr(HTMLEncode(trim(request("homeurl"))))
			end if
		WrForm(3) = CheckStr(trim(request("mail")))
		WrForm(4) = CheckStr(HTMLEncode(trim(request("content"))))
		WrForm(5) = CheckStr(request("face"))
		WrForm(6) = cstr(now())
		WrForm(7) = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		If WrForm(7) = "" Then WrForm(7) = Request.ServerVariables("REMOTE_ADDR")
		if CheckStr(request("show")) = "on" then
			WrForm(8) = False
		else
			WrForm(8) = True
		end if
		WrForm(9) = trim(Request("fromm"))
		strconn = "insert into ebook(fname,fqq,fhomeurl,fmail,fcontent,fface,ftime,fip,fshow,ffrom) values('" & WrForm(0) & "','" & WrForm(1) & "','" & WrForm(2) & "','" & WrForm(3) & "','" & WrForm(4) & "','" & WrForm(5) & "','" & WrForm(6) & "','" & WrForm(7) & "'," & WrForm(8) & ",'" & WrForm(9) & "')"
		conn.execute (strconn)
				if err.number = 0 then
					response.redirect ("index.asp")
					response.end
				else
					session("imsg") = "2"
					response.redirect ("msg.asp")

					response.end
				end if
	end if
	set facelist_rs = conn.execute("select * from face")
%>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="bodybg">
  <tr>

    <td width="169" valign="top">	

		<!-- #include file="Untitled-1.asp" -->
	</td>

    <td width="631" valign="top"><table width="90%" height="250" align="center" cellpadding="0" cellspacing="0">
      <form method="post"  name="input" action="write.asp?action=new" onSubmit="return Validator.Validate(this,2);">
        <tr>
          <td colspan="5" align="center">签写留言<br>
              <hr size="1" color="#eeeeee"></td>
        </tr>
        <tr>
          <td colspan="5" height="5"></td>
        </tr>
        <tr>
          <td width="120" align="right">昵称:</td>
          <td width="20" align="right">&nbsp;</td>
          <td colspan="2"><input name="name" type="text" id="name" size="30" maxlength="12" dataType="Require" msg="昵称不能为空">
    &nbsp;<span style="color: #990000">*</span></td>
          <td width="180" rowspan="4"><img id="strcaput" src="images/humen/1.gif" width="75" height="75"></td>
        </tr>
        <tr>
          <td align="right">Q Q:</td>
          <td align="right">&nbsp;</td>
          <td colspan="2"><input name="qq" type="text" id="qq" size="30" maxlength="10" dataType="QQ"  msg="QQ号吗有问题">
    &nbsp;<span style="color: #990000">*</span></td>
        </tr>
        <tr>
          <td align="right">主页:</td>
          <td align="right">&nbsp;</td>
          <td colspan="2"><input name="homeurl" type="text" id="homeurl" size="30"  require="false" dataType="Url"   msg="非法的Url,是不是没加http://呢?"></td>
        </tr>
        <tr>
          <td align="right">信箱:</td>
          <td align="right">&nbsp;</td>
          <td colspan="2"><input name="mail" type="text" id="mail" size="30" dataType="Email" msg="信箱格式不正确">
    &nbsp;<span style="color: #990000">*</span></td>
        </tr>
        <tr>
          <td align="right">来自:</td>
          <td align="right">&nbsp;</td>
          <td colspan="2"><input name="fromm" type="text" id="fromm" size="30">
    &nbsp;</td>
        </tr>
        <tr>
          <td align="right">头像:</td>
          <td align="right">&nbsp;</td>
          <td colspan="2"><select name="face" onChange="document.images['strcaput'].src=options[selectedIndex].value;">
              <%
					set caput_rs = server.createobject("ADODB.Recordset")
					caput_sql = "select * from fcaput"
					caput_rs.open caput_sql,conn,1,1
					
					for i=1 to caput_rs.recordcount
						response.write ("<option value='images/humen/" & caput_rs("ca_image") & "'>image" & i & "</option>")
						caput_rs.movenext
					next
					%>
            </select>
&nbsp;悄悄话:&nbsp;&nbsp;
        <input name="show" type="checkbox">
          </td>
          <td>&nbsp;</td>
        </tr>
        <tr height="28">
          <td align="right">UBB:</td>
          <td>&nbsp;</td>
          <td colspan="3" align="left" valign="bottom"><select name="font" onFocus="this.selectedIndex=0" onChange="chfont(this.options[this.selectedIndex].value)" size="1">
              <option value="" selected>选择字体</option>
              <option value="宋体">宋体</option>
              <option value="黑体">黑体</option>
              <option value="Arial">Arial</option>
              <option value="Book Antiqua">Book Antiqua</option>
              <option value="Century Gothic">Century Gothic</option>
              <option value="Courier New">Courier New</option>
              <option value="Georgia">Georgia</option>
              <option value="Impact">Impact</option>
              <option value="Tahoma">Tahoma</option>
              <option value="Times New Roman">Times New Roman</option>
              <option value="Verdana">Verdana</option>
            </select>
              <select name="size" onFocus="this.selectedIndex=0" onChange="chsize(this.options[this.selectedIndex].value)" size="1">
                <option value="" selected>字体大小</option>
                <option value="-2">-2</option>
                <option value="-1">-1</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
              </select>
              <select name="color"  onFocus="this.selectedIndex=0" onChange="chcolor(this.options[this.selectedIndex].value)" size="1">
                <option value="" selected>字体颜色</option>
                <option value="White" style="background-color:white;color:white;">White</option>
                <option value="Black" style="background-color:black;color:black;">Black</option>
                <option value="Red" style="background-color:red;color:red;">Red</option>
                <option value="Yellow" style="background-color:yellow;color:yellow;">Yellow</option>
                <option value="Pink" style="background-color:pink;color:pink;">Pink</option>
                <option value="Green" style="background-color:green;color:green;">Green</option>
                <option value="Orange" style="background-color:orange;color:orange;">Orange</option>
                <option value="Purple" style="background-color:purple;color:purple;">Purple</option>
                <option value="Blue" style="background-color:blue;color:blue;">Blue</option>
                <option value="Beige" style="background-color:beige;color:beige;">Beige</option>
                <option value="Brown" style="background-color:brown;color:brown;">Brown</option>
                <option value="Teal" style="background-color:teal;color:teal;">Teal</option>
                <option value="Navy" style="background-color:navy;color:navy;">Navy</option>
                <option value="Maroon" style="background-color:maroon;color:maroon;">Maroon</option>
                <option value="LimeGreen" style="background-color:limegreen;color:limegreen;">LimeGreen</option>
            </select></td>
        <tr height="28">
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="3" align="left"><a href="javascript:bold()"><img src="images/ubb/ubb_bold.gif" border="0" onMouseOver="toolTip('插入粗体文本', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:italicize()"><img src="images/ubb/ubb_italicize.gif" border="0" onMouseOver="toolTip('插入斜体文本', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:underline()"><img src="images/ubb/ubb_underline.gif" border="0" onMouseOver="toolTip('插入下划线', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:hyperlink()"><img src="images/ubb/ubb_url.gif" border="0" onMouseOver="toolTip('插入超级链接', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:email()"><img src="images/ubb/ubb_email.gif" border="0" onMouseOver="toolTip('插入邮件地址', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:image()"><img src="images/ubb/ubb_image.gif" border="0" onMouseOver="toolTip('插入图片', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:code()"><img src="images/ubb/ubb_code.gif" border="0" onMouseOver="toolTip('插入代码', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:wma()"><img src="images/ubb/ubb_wma.gif" border="0" onMouseOver="toolTip('插入音乐', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:wmv()"><img src="images/ubb/ubb_wmv.gif" border="0" onMouseOver="toolTip('插入影片', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> <a href="javascript:flash()"><img src="images/ubb/ubb_flash.gif" border="0" onMouseOver="toolTip('插入flash', '#f2f2f2', '#666666')" onMouseOut="toolTip()"></a> </td>
        </tr>
        <tr>
          <td align="right">留言:</td>
          <td align="right"></td>
          <td colspan="3"><textarea name="content" style="width:400px" rows="9" wrap="VIRTUAL" id="Message" onSelect="javascript: storeCaret(this);" onClick="javascript: storeCaret(this);" dataType="LimitB" max="<%= cint(imax) %>" min="10" msg="内容过少或超出限定字符数"></textarea></td>
        </tr>
        <tr>
          <td align="right" valign="middle">表情:</td>
          <td align="right"></td>
          <td colspan="3"><table border="0" style="table-layout:fixed;word-wrap:break-word;" width="420" cellpadding="4" cellspacing="6" align="left">
              <tr>
                <td><%
			   do while not facelist_rs.eof
				   response.write ("<img style=""cursor:hand;"" onclick=""AddText('"&facelist_rs("face_text") &"');"" src=""images/face/"&facelist_rs("face_image")&""">&nbsp;&nbsp;")
				   facelist_rs.movenext
			   loop
			%>
                </td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td align="right">验证:</td>
          <td align="right">&nbsp;</td>
          <td colspan="3"><input name="yzcode" type="text" size="5" maxlength="4" dataType="Require" msg="没有输入验证码">
&nbsp;&nbsp;<img src="include/code.asp" border="0"></td>
        </tr>
        <tr>
          <td height="30" colspan="5" align="center"><input type="submit" value="确定" class="submitinput">
    &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="reset" value="重置" class="submitinput"></td>
        </tr>
      </form>
    </table></td>
  </tr>
</table>
<script language="javascript" src="include/checkform.js"></script>

<%
	session("imsg") = nothing
	caput_rs.close
	set caput_rs = nothing
	facelist_rs.close
	set facelist_rs = nothing
	rs.close
	set rs = nothing
	conn.close
	set conn = nothing
%>
<!-- #include file="footer.asp" -->