|
楼主 |
发表于 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
%>
|
|