找回密码
 注册
搜索
查看: 3149|回复: 3

会员卡程序,仅供参考

[复制链接]
发表于 2002-5-19 17:57:34 | 显示全部楼层 |阅读模式
会员卡程序由查询、使用两部分组成,分别有 HTM 和 ASP 文件对应。
下面只给出 ASP 参考文件。
 楼主| 发表于 2002-5-20 01:59:42 | 显示全部楼层
查询的ASP程序模块:
<%
dim card, ID, Pwd, SQL
card = request.form(\"card\")
ID = request.form(\"ID\")
Pwd = request.form(\"wd\")
Set conn=Server.CreateObject(\"ADODB.Connection\")
conn.open \"dsn=数据源名\"
response.write \"查询结果如下:\"
sql = \"select * from 会员卡 where ID=\'\" & ID & \"\'\"
set rs = conn.execute(sql)
if not rs.eof then
if rs(\"密码\") = Pwd then
  if rs(\"状态\") = \"1\" then
   response.write \"该卡未使用!\"
  else
   response.write \"该卡已经使用或已过期!\"
  end if
else
  response.write \"密码不正确!\"
end if
else
response.write \"此卡号不存在!\"
end if
set rs = nothing
conn.close
set conn = nothing
response.end
%>
回复

使用道具 举报

 楼主| 发表于 2002-5-20 02:05:33 | 显示全部楼层
用卡程序,仅供参考
<%
dim card, ID, Pwd, toID, toDo
toDo = 0
card = request.form(\"card\")
ID = request.form(\"ID\")
Pwd = request.form(\"wd\")
toID = request.form(\"toID\")
Set conn=Server.CreateObject(\"ADODB.Connection\")
conn.open \"dsn=会员卡数据源名\"
response.write \"使用情况:\"
set rs = conn.execute(\"select * from 会员卡 where ID=\'\" & ID & \"\'\")
if not rs.eof then
if rs(\"密码\") = Pwd then
  if rs(\"状态\") = \"1\" then
   response.write \"成功操作,江湖ID号:\" & toID & \" 增加会员时间32天。\"
   conn.execute \"update 会员卡 set 状态=\'0\' where ID=\'\" & ID & \"\'\"
   toDo = 1
  else
   response.write \"该卡已经使用或已过期!\"
  end if
else
  response.write \"密码不正确!\"
end if
else
response.write \"此卡号不存在!\"
end if
set rs = nothing
conn.close
set conn = nothing
if toDo = 1 then
Set conn=Server.CreateObject(\"ADODB.Connection\")
conn.open \"dsn=江湖数据源\"
set rs=conn.execute(\"select * from Y where ID=\" & toID)
if not rs.eof then
  if rs(\"T\") = \"1\" then
   conn.execute \"update Y set D3=D3+32 where ID=\" & toID
  else
   conn.execute \"update Y set T=\'1\',D3=Now()+32 where ID=\" & toID
  end if
else
  response.write \"(江湖ID号不存在,操作失误)\"
end if
set rs=nothing
conn.close
set conn = nothing
end if
response.end
%>
回复

使用道具 举报

老太太 该用户已被删除
发表于 2002-6-2 02:03:29 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|宁德市腾云网络科技有限公司 ( 闽ICP备2022007940号-5|闽公网安备 35092202000206号 )

GMT+8, 2025-6-19 13:53 , Processed in 0.015362 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表