<!--#include file="conn.asp"-->
<%user=request.form("user")
name=request.form("name")
email=request.form("email")
http=request.form("http")
oicq=request.form("oicq")
icq=request.form("icq")
face=request.form("face")
area=request.form("area")
ly=request.form("ly")
ly=server.HTMLEncode(ly)
  set rs1=server.createobject("adodb.recordset")
sql="select * from user where username='" & user &"'"
rs1.Open SQL,conn,1,2
if rs1.BOF or rs1.EOF then
kind=5
else
kind=rs1("kind")
end if
set rs1=nothing
rs1.close
ip=Request.ServerVariables("REMOTE_ADDR")
nowtime=now()
if user="" or name="" or email="" or ly="" then
msg="内容不全，请填写所有内容！"
else
if request.cookies("chkly")=ly then
msg="留言内容不能相同！"
else
response.cookies("chkly")=ly
%>

 <%
Set rs = Conn.Execute("select * from user where username = '" & user & "'")
if not(rs.eof or rs.bof) then
sql="Insert into book(user,name,email,area,http,oicq,icq,face,ip,ly,addtime) values ('"&user&"','"&name&"','"&email&"','"&area&"','"&http&"','"&oicq&"','"&icq&"','"&face&"','"&ip&"','"&ly&"','"&nowtime&"')"
conn.execute (sql)
sql="update user set count=count+1 where username='" & user & "'"
conn.execute (sql)
'rs("count")=rs("count")+1
'rs.update
msg="成功留言"
else
conn.close
rs.close
set conn=nothing
set rs=nothing
msg="没有此用户"
end if
end if
end if 

%>
<html>
<head>
<meta HTTP-EQUIV=refresh Content='2;url=guestbook.asp?user=<%=user%>'>
<title>提交留言</title>

<link rel="stylesheet" type="text/css" href="style/<%=kind%>.css">
</head>
<table width="600" align="center" cellspacing="0" cellpadding="1"  border="0" bgcolor=#000000>
  <tr> 
    <td> 
      <table width="600" cellspacing="0" cellpadding="4" border="0" class="table002">
        <tr> 
          <td class="jnfont7" valign="middle" align=left> <b>>> </b> <a href="<%=web%>"><acronym title="返回主页">主页</acronym></a> 
            | <a href="modify.asp?user=<%=user%>"><acronym title="编辑你的个人资料">修改资料</acronym></a> 
            | <%if  adminok="ok" then%><a href="usermanager.asp?user=<%=user%>&exit=ok"><acronym title="退出管理">退出管理</acronym></a><%else%><a href="usermanager.asp?user=<%=user%>"><acronym title="回复或删除留言">留言管理</acronym></a><%end if%> 
            | <a href="default.asp"><acronym title="免费申请留言本">免费申请</acronym></a> 
            | <a href="top.asp"><acronym title="留言排行榜">留言排行</acronym></a> </td>
          <td class="jnfont7" valign="middle" align=right><b><%=webname%></b></td>
        </tr>
      </table>
    </td>
  </tr>
</table> 
<div align="center">
<table align="center"><td class="jnfont3" ><p align="center" > 提示：<%=msg%><BR>
  2秒后将自动『<a href="guestbook.asp?user=<%=user%>">返回</a>』</P></td></table></div>
<table border="0" width="560" cellpadding="0" align="center">
  <tr> 
    <td width="100%"> 
      <hr size="1" width="80%">
    </td>
  </tr>
  <tr> 
    <td width="100%" class="jnfont6"> 
          <p align="center">
            <a href=http://www.5151.cn target=_blank>免费留言本由[中泰科技]提供</a>
        </td>
      </tr>
    </table>     
<p align="center">&nbsp;</P>
</body>
</html>