📄 checkuserlogin.asp
字号:
<!--
┌─9911.com.cn────────────┐
│ 动感购物 WWW.9911.com.cn 版权所有 │
│ 动感购物2005Vb 联系:web@snsn.net │
└───────────9911.com.cn──┘
-->
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="webconfig.asp"-->
<%
dim action
dim username,userpassword,comeurl,yzm,yzm1
action=nosql(request.QueryString("action"))
select case action
case ""
username=checkFFSQLStr(trim(request("username")))
userpassword=md5(trim(request("userpassword")))
yzm=trim(request("yzm"))
yzm1=trim(request("yzm1"))
if username="" or userpassword="" then
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
response.end
end if
if yzm="" or yzm<>yzm1 then
response.write "<script LANGUAGE='javascript'>alert('对不起!验证码有误!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [shop_user] where username='"&username&"' and userpassword='"&userpassword&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if userpassword=rs("userpassword") then
session("reglx")=rs("reglx")
session("jifen")=rs("jifen")
session("jiaoyijine")=rs("jiaoyijine")
session("username")=trim(request("username"))
session("userpassword")=userpassword
session("manbid")=rs("manbid")
session("pic")=rs("pic")
session("Cookies")=Cookies
if int(cookies)<>0 then
Response.Cookies("snsn").Expires=date+int(cookies)
end if
rs("lastlogin")=now()
rs("logins")=rs("logins")+1
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
rs.Close
set rs=nothing
username=trim(request("username"))
conn.execute("delete from shop_action where username='"&username&"' and zhuangtai=7")
conn.execute("delete from shop_action_jp where username='"&username&"' and zhuangtai=7")
if request("linkaddress")="" then
response.redirect request.servervariables("http_referer")
else
response.redirect request("linkaddress")
'response.redirect "index.asp"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
end if
case "1"
username=checkFFSQLStr(trim(request("username")))
userpassword=md5(trim(request("userpassword")))
if username="" or userpassword="" then
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [shop_user] where username='"&username&"' and userpassword='"&userpassword&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if userpassword=rs("userpassword") then
session("reglx")=rs("reglx")
session("jifen")=rs("jifen")
session("jiaoyijine")=rs("jiaoyijine")
session("username")=trim(request("username"))
session("userpassword")=userpassword
session("manbid")=rs("manbid")
session("pic")=rs("pic")
session("Cookies")=Cookies
shopid=request("shopid")
rs("lastlogin")=now()
rs("logins")=rs("logins")+1
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
rs.Close
set rs=nothing
username=trim(request("username"))
conn.execute("delete from shop_action where username='"&username&"' and zhuangtai=7")
conn.execute("delete from shop_action_jp where username='"&username&"' and zhuangtai=7")
if len(shopid)=0 then
response.Redirect "gouwu.asp?action=show"
end if
Set rs_s=Server.CreateObject("Adodb.RecordSet")
rs_s.Open "Select * from shop_snsn where shopid in ("&shopid&")",Conn,3,3
while not rs_s.eof
if session("reglx")=2 then
danjia=rs_s("vipjia")
else
danjia=rs_s("huiyuanjia")
end if
kucun=rs_s("kucun")
shopname=rs_s("shopname")
if kucun<=0 then
response.write "<script language=javascript>alert('你选购的商品“"&shopname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action where username='"&username&"' and shopid="&trim(rs_s("shopid"))&" and zhuangtai=7",conn,1,3
if rs.recordcount=1 then
'//修改数量
if kucun<(rs("shopcount")+1) then
response.write "<script language=javascript>alert('你选购的商品“"&shopname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
rs("zonger")=(rs("shopcount")+1)*danjia
rs("shopcount")=rs("shopcount")+1
rs.update
rs.close
set rs=nothing
else
'//添加购物
rs.close
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action",conn,1,3
rs.addnew
rs("shopid")=trim(rs_s("shopid"))
rs("username")=username
rs("zhuangtai")=7
rs("shopcount")=1
rs("zonger")=danjia
rs.update
rs.close
set rs=nothing
end if
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
response.Redirect "gouwu.asp?action=show"
else
response.write "<script LANGUAGE='javascript'>alert('对不起,您的用户名或密码有误!');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或密码有误!');history.go(-1);</script>"
end if
case "3"
username=checkFFSQLStr(trim(request("username")))
userpassword=md5(trim(request("userpassword")))
useremail=nosql(trim(request("useremail")))
shopid=nosql(trim(request("shopid")))
if useremail="" or username="" or userpassword="" then
response.write "<script LANGUAGE='javascript'>alert('对不起!请填写完整注册资料!');history.go(-1);</script>"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user] where useremail='"&useremail&"' or username='"&username&"'",conn,1,1
if rs.recordcount>0 then
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名已经被人注册!');history.go(-1);</script>"
rs.close
else
rs.close
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user]",conn,1,3
rs.addnew
rs("username")=nosql(trim(request("username")))
rs("userpassword")=md5(trim(request("userpassword")))
rs("useremail")=nosql(trim(request("useremail")))
rs("quesion")="1234"
rs("answer")=md5(1234)
rs("adddate")=now()
rs("lastlogin")=now()
rs("logins")=1
rs("zhifufangshi")=0
rs("songhuofangshi")=0
rs("reglx")=1
rs("jifen")=0
rs("jiaoyijine")=0
Rs("sex")=1
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")
rs("manbid")=0
rs("pic")="face/1.gif"
rs("zw")="普通会员"
rs.update
rs.close
set rs=nothing
session("username")=trim(request("username"))
session("userpassword")=md5(trim(request("userpassword")))
session("manbid")=0
conn.execute("update [info] set newuser='"&username&"',alluser=alluser+1")
set rs=conn.execute("select top 1 userid from [shop_user] order by userid desc")
userid=rs(0)
session("jiaoyijine")=0
session("jifen")=0
session("reglx")=1
response.Cookies("shangcheng").expires=date+1
session("regtimes")=1
session.Timeout=1
shopid=nosql(trim(request("shopid")))
username=nosql(trim(request("username")))
conn.execute("delete from shop_action where username='"&username&"' and zhuangtai=7")
conn.execute("delete from shop_action_jp where username='"&username&"' and zhuangtai=7")
if len(shopid)=0 then
response.Redirect "gouwu.asp?action=show"
end if
Set rs_s=Server.CreateObject("Adodb.RecordSet")
rs_s.Open "Select * from shop_snsn where shopid in ("&shopid&")",Conn,3,3
while not rs_s.eof
if session("reglx")=2 then
danjia=rs_s("vipjia")
else
danjia=rs_s("huiyuanjia")
end if
kucun=rs_s("kucun")
shopname=rs_s("shopname")
if kucun<=0 then
response.write "<script language=javascript>alert('你选购的商品“"&shopname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action where username='"&username&"' and shopid="&trim(rs_s("shopid"))&" and zhuangtai=7",conn,1,3
if rs.recordcount=1 then
'//修改数量
if kucun<(rs("shopcount")+1) then
response.write "<script language=javascript>alert('你选购的商品“"&shopname&"”暂时缺货不能放到购物车里,请选购其它商品!');window.close();</script>"
response.end
end if
rs("zonger")=(rs("shopcount")+1)*danjia
rs("shopcount")=rs("shopcount")+1
rs.update
rs.close
set rs=nothing
else
'//添加购物
rs.close
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_action",conn,1,3
rs.addnew
rs("shopid")=trim(rs_s("shopid"))
rs("username")=username
rs("zhuangtai")=7
rs("shopcount")=1
rs("zonger")=danjia
rs.update
rs.close
set rs=nothing
end if
rs_s.movenext
wend
rs_s.close
set rs_s=nothing
response.Redirect "gouwu.asp?action=show"
end if
end select
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -