adds.asp

来自「创建和运行动态、交互的Web服务器应用程序」· ASP 代码 · 共 34 行

ASP
34
字号
<!--#include file="conn.asp"-->
<HTML>
  <HEAD><TITLE>返回</TITLE></HEAD>
  <BODY>
<%
  dim oRS2
  Dim selected 		' 声明选择项变量
  ' 从Request对象中获取选择项值
  selected = Request.Form("options")
  Set oRS2 = Server.CreateObject("ADODB.Recordset")
  ' 修改原有的记录值,使选择项的值加1
if session("diaocha")<>hour(now) then
  oRS2.Open "SELECT * FROM shop_Search ",conn,1,3
  select case selected
         case "a"
  oRS2("sela")=oRS2("sela")+1
         case "b"
  oRS2("selb")=oRS2("selb")+1
         case "c"
  oRS2("selc")=oRS2("selc")+1
  end select
  oRS2("tptime")=now
  oRS2.update
  ' 关闭数据库,释放内存变量
  oRS2.Close
  Set oRS2 = Nothing
  session("diaocha")=hour(now)
  response.Write "<script language='javascript'>alert('您的投票已提交,谢谢参与!');window.location.reload('index.asp')</script>"
else
  response.Write "<script language='javascript'>alert('您已经投过票,请不要重复!');window.location.reload('index.asp')</script>"
end if
%>
 </BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?