📄 mb_api_loginok.asp
字号:
<!--#include file="set_url.asp"-->
<!--#include file="Mb_API_Md5.asp" -->
<!--#include file="film_conn.asp"-->
<%
'定义参数
Dim strLoginName
Dim strLoginPwd
Dim ip
Dim PIN
'取得返回的手机号码和IP地址
strLoginName = trim(Request("Number"))
strLoginPwd = trim(Request("pwd"))
ip = Request.ServerVariables("REMOTE_ADDR")
'进行MD5验证
PIN = md5("OK" & UserCode & strLoginName & ip & CStr(Date()), 16)
'如果验证通过,则给用户权限
if PIN = trim(Request("PIN")) then
dim rs,sql,sql1
set rs=server.createobject("adodb.recordset")
sql="select userid from users where userid='"&strLoginName&"'"
rs.open sql,conn,1,2
'如果用户不存在,先将手机用户注册成为会员
if rs.eof then
birthday="2000-01-01"
set rs=server.createobject("adodb.recordset")
sql1="select * from users"
rs.open sql1,conn,1,3
rs.addnew
rs("userid")=strLoginName
rs("password")=strLoginPwd
rs("name")=strLoginName
rs("email")="demo@demo.com"
rs("phone")=strLoginName
rs("Province")="北京市"
rs("city")="东城区"
rs("question")="你最爱的人是谁"
rs("ask")="我的老婆"
rs("sex")="男"
rs("askmejoin")="e9160"
rs("birthday")=birthday
rs("money")=now()+3650 '注册设为10年有效,因为登录时需到E9160确认,所以此处无需担心
rs("oklook")=3 '设为黄金会员
rs("lasthits")=date()
rs("ip")=ip
rs("mb_pay")=true '识别为E9160手机用户,以不允许该用户通过正常方式登录
rs.update
end if
'以下开始加权限代码
conn.Execute("update users set nos=nos+1 where userid='"&strLoginName&"'")
response.cookies("userid")=strLoginName
response.cookies("password")=strLoginPwd
response.cookies("okerer")="yesok"
application(""&strLoginName&"")="yes"
response.cookies("myter")="yes"
response.cookies("userid").expires=now()+5
response.write "<SCRIPT LANGUAGE=JavaScript>alert ('恭喜,登录成功!您现在可以观看/下载电影了!');window.focus();</script>"
response.redirect ""&weburl&""
response.end
else
'验证不通过,返回失败信息,不做处理
response.write "<SCRIPT LANGUAGE=JavaScript>alert ('对不起,登录验证失败!');window.focus();</script>"
response.redirect ""&weburl&""
response.end
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -