comment.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <%
  6. dim id
  7. id=request.QueryString("id")
  8. if NOT isempty(request("CommentSubmit")) then
  9. set rs=server.CreateObject("adodb.recordset")
  10. rs.open "select * from review",conn,1,3
  11. rs.addnew
  12. rs("id")=id
  13. rs("title")=HTMLEncode2(trim(request("title")))
  14. rs("reviewcontent")=HTMLEncode2(trim(request("reviewcontent")))
  15. rs("reviewdtm")=now()
  16. rs("audit")=0
  17. rs.update
  18. rs.close
  19. set rs=nothing
  20. call MsgBox("您的评论已成功提交,经我们审核通过后方可发布!","Close","None")
  21. response.End
  22. end if
  23. %> 
  24. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  25. <html>
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  28. <title>406网络书店</title>
  29. <link href="style.css" rel="stylesheet" type="text/css">
  30. </head>
  31. <body>
  32. <!--#include file="head.htm"-->
  33. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  34.   <tr>
  35.     <td width="219" align="left" valign="top"><!--#include file="left.asp"--></td>
  36.     <td width="561" align="left" valign="top">      <table width="100%" border="0" cellspacing="1" cellpadding="2">
  37.         <tr>
  38.           <td ><DIV ALIGN="CENTER"><FONT COLOR="#FFFFFF" SIZE="4"><B>发表评论</B></FONT></DIV></td>
  39.         </tr>
  40.         <tr>
  41.           <form name="reviewform" method="post" action="">
  42.             <td>
  43.               <table width="100%" border="0" cellpadding="2" cellspacing="1" >
  44.                 <tr >
  45.                   <td width="23%">您的姓名:</td>
  46.                   <td width="77%">
  47.                     <input name="title" type="text" id="title" size="12">
  48.                     <input name="id" type="hidden" id="id" value="<%=id%>">
  49. </td>
  50.                 </tr>
  51.                 <tr >
  52.                   <td valign="top">评论正文:</td>
  53.                   <td >
  54.                     <textarea name="reviewcontent" cols="26" rows="5" id="reviewcontent"></textarea>
  55.                   </td>
  56.                 </tr>
  57.                 <tr align="center" >
  58.                   <td colspan="2">                    
  59.                       <input name="CommentSubmit" type="submit" id="CommentSubmit" onClick="return check();" value="提交">
  60. &nbsp;
  61.                 <input type="reset" name="Submit2"  value="清除">
  62.                 <script language="javascript">
  63. <!--
  64. function checkspace(checkstr) {
  65.   var str = '';
  66.   for(i = 0; i < checkstr.length; i++) {
  67.     str = str + ' ';
  68.   }
  69.   return (str == checkstr);
  70. }
  71. function check()
  72. {
  73.   if(checkspace(document.reviewform.title.value)) {
  74. document.reviewform.title.focus();
  75.     alert("请填写您的姓名!");
  76. return false;
  77.   }
  78.   if(checkspace(document.reviewform.reviewcontent.value)) {
  79. document.reviewform.reviewcontent.focus();
  80.     alert("请填写评论正文!");
  81. return false;
  82.   }
  83.   }
  84.   //-->
  85.                 </script>
  86. </div></td>
  87.                 </tr>
  88.             </table></td>
  89.           </form>
  90.         </tr>
  91.     </table></td>
  92.   </tr>
  93. </table>
  94. <!--#include file="foot.htm"-->
  95. </body>
  96. </html>