<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<title><%=webname%>--用户评论</title>
<%
dim id,action
id=SafeRequest("id",1)
action=request.form("action")
if action="save" then

function HTMLEncode2(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	HTMLEncode2 = fString
end function

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from review",conn,1,3
rs.addnew
rs("id")=id
rs("title")=HTMLEncode2(trim(request.form("title")))
rs("reviewcontent")=sqlCheckstr(trim(request.form("reviewcontent")))
rs("reviewdtm")=now()
rs("audit")=0
rs("ipaddr") = Request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
set rs=nothing
response.write "<br><br><table width=96% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=86 bgcolor=#F5F5F5><div align=center>"
response.write "您的评论已成功提交!<br><br><a href=javascript:window.close()>关闭窗口</a></div></td></tr></table>"
response.End
end if
%> 
<table align="center" width="300" border="0" cellpadding="0" cellspacing="0">
  <tr><td width="12"><img src="images/top1.gif" border="0"></td>
  <td background="images/top2.gif" width="98%"></td>
  <td width="65"><img src="images/top3.gif" border="0"></td></tr>
  </table>
<table width="300" border="0" height="200" cellpadding="0" cellspacing="0" align="center" class=table-zuoyou> 
<form name="reviewform" method="post" action="comment.asp?action=save&id=<%=id%>">
<tr> 
<td align="center" background="images/titlebg.gif" colspan="2" height="28"><b>发表评论</b></td></tr> 
<tr>
<td width="25%" height="25" class=table-youxia>您的姓名：</td>
<td width="75%" class=table-xia>&nbsp;<input name="title" type="text" id="title" size="15" maxlength="15"> 
</td></tr> 
<tr><td valign="top" class=table-youxia>评论正文：</td>
<td class=table-xia> &nbsp;<textarea name="reviewcontent" cols="38" rows="8" id="reviewcontent"></textarea> 
</td></tr> 
<tr><td colspan="2" align="center">
<input name="action" type="hidden" value="save">
<input type="submit" name="Submit"style="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee" value="提 交" onClick="return check();"> 
&nbsp; <input type="reset" name="Submit2" style="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee" value="清 除"> 
</td></tr></form></table>
<table align="center" width="300" border="0" cellpadding="0" cellspacing="0">
  <tr><td width="12"><img src="images/end1.gif" border="0"></td>
  <td background="images/end2.gif" width="98%"></td>
  <td width="65"><img src="images/end3.gif" border="0"></td></tr>
  </table>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.reviewform.title.value)) {
	document.reviewform.title.focus();
    alert("请填写您的姓名！");
	return false;
  }
  if(checkspace(document.reviewform.reviewcontent.value)) {
	document.reviewform.reviewcontent.focus();
    alert("请填写评论正文！");
	return false;
  }
	  }
	  //-->
</script>
