savereview.asp
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:2k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="articleconn.asp"-->
  2. <!--#include file="inc/articlechar.inc"-->
  3. <%
  4. if request.form("reviewname")="" then
  5.   ' Request.Form("reviewname")
  6.    'response.redirect"index.asp"
  7.    response.write"<script>alert('请填写您的大名!');</Script><script Language=Javascript>location.href = 'javascript:history.go(-1)';</script>"
  8.    response.end
  9. end if
  10. if request.form("review")="" then
  11.   ' Request.Form("review")
  12.    'response.redirect"index.asp"
  13.    response.write"<script>alert('评论内容不能为空,请重新输入!');</Script><script Language=Javascript>location.href = 'javascript:history.go(-1)';</script>"
  14.    response.end
  15. end if
  16. if len(request.form("review"))>800 then  
  17.     response.write"<script>alert('评论内容不能太多,请重新输入!');</Script><script Language=Javascript>location.href = 'javascript:history.go(-1)';</script>"
  18.    response.end
  19. end if   
  20.   reviewname=htmlencode2(request.form("reviewname"))
  21.   reviewemail=htmlencode2(request.form("reviewemail"))
  22.   review=htmlencode2(request.form("review"))
  23.   face=Request.Form("face") 
  24. reviewurl=Request.Form("reviewurl") 
  25. articleid=clng(request("id"))
  26. reviewtitle=request("reviewtitle")
  27. IP=Request("REMOTE_ADDR")
  28.   
  29. set rs=server.createobject("adodb.recordset")
  30. sql="select review,reviewcount from learning where articleid="&articleid
  31. rs.open sql,conn,3,3
  32.  rs("reviewcount")=rs("reviewcount")+1
  33. rs("review")=rs("review")&"<br><img src=images/mood"&face&".gif><font color=red> 评论者:</font>"&reviewname&_
  34.        "<font>  </font><font face=""Wingdings""></font><font color=red>个人网页:</font><a href="""&reviewurl&""">"_
  35.          &reviewurl&"</a><table bgcolor=""#F7F7F7"" cellspacing=""0"" cellpadding=""5"" border=""0"" width=""100%"" align=""center""><tr><td width=""100%"" style=""font-size:9pt""><strong><font color=green>"&reviewtitle&"</font></strong><br>"&_
  36.          review&"<br><br><font style=""font-size:8pt"">--发表日期:"&date()&"<br>[来自: "&ip&"]</font><br></td></tr></table>  " 
  37. rs.update
  38. response.redirect "re.asp?ID="&clng(request("id"))
  39. rs.close
  40. set rs=nothing
  41. conn.close
  42. set conn=nothing
  43. %>
  44. <head>
  45. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  46. <meta name="ProgId" content="FrontPage.Editor.Document">
  47. </head>
  48. </body>
  49. </html>