<!--#include file="conn.asp"-->
<!--#include file="buy2buysys.asp"-->
<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>

<%
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")=HTMLEncode2(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
%> 
