📄 reg.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
<!--#include file=conn.asp-->
<!--#include file="admin/md5.asp"-->
<wml>
<head>
<meta http-equiv="Cache-Control" content="must-revalidate" forua="true"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>
<meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
<meta http-equiv="Expires" content="0" forua="true"/>
<meta http-equiv="Pragma" content="no-cache" forua="true"/>
</head>
<%
IF (Request.QueryString("Action")="reg") Then
call reg
elseIF (Request.QueryString("Action")="exit") Then
session("name")= ""
session("pid")= ""
elseIF (Request.QueryString("Action")="login") Then
call login
elseIF (Request.QueryString("Action")="save") Then
call save
else
call main
End IF
%>
<%sub main
%>
<card id="login" title="登陆/注册">
<p align="<%=const_index%>">
用户名:<br/>
<input name="name" emptyok="false" maxlength="20"/><br/>
密码:<br/>
<input name="pass" emptyok="false" maxlength="40"/><br/>
<anchor>登陆<go href="reg.asp?Action=login" method="post"><postfield name="name" value="$(name)" /><postfield name="pass" value="$(pass)" /></go></anchor>|<a href="reg.asp?Action=reg">注册</a>|<a href="index.asp">首页</a><br/>
</p>
</card>
<%end sub
sub reg%>
<card id="add" title="免费注册">
<p align="<%=const_index%>">
用户名<br/>
<input name="name" emptyok="false" maxlength="40"/><br/>
密码<br/>
<input name="pass" emptyok="false" maxlength="80"/><br/>
密码<br/>
<input name="pass2" emptyok="false" maxlength="80"/><br/>
手机号<br/>
<input name="mobile" format="*N" maxlength="13"/><br/>
<anchor>注册
<go href="reg.asp?Action=save" method="post">
<postfield name="name" value="$(name:n)" />
<postfield name="pass" value="$(pass:n)" />
<postfield name="pass2" value="$(pass2:n)" />
<postfield name="mobile" value="$(mobile:n)" />
</go>
</anchor><br/>
<a href="index.asp">返回首页</a><br/>
</p>
</card>
<%end sub
sub login
name=utf8(Trim(Request("name")))
pass=md5(Trim(utf8(Request("pass"))))
IF name<>"" and pass<>"" then
set rs=Server.CreateObject("ADODB.Recordset")
Sql = "select * from wap_user where name='"&name&"' and pass='"&pass&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%> <card id="login" title="登陆出错">
<p align="<%=const_index%>">
用户名或密码不对,或您未注册。<br/>
<a href="reg.asp?Action=login">登陆</a>|<a href="reg.asp?Action=reg">注册</a><br/>
<a href="index.asp">智能首页</a><br/><a href="/wap/"> 网站首页</a><br/>
</p>
</card>
<% else
session("name")= rs("name")
session("id")= rs("id")
rs.Close
Set rs = Nothing
%> <card id="login" title="登陆成功" ontimer="index.asp"><timer value='20'/>
<p align="<%=const_index%>">
恭喜,你已成功登陆。<br/>
<a href="index.asp">马上进入</a><br/>
</p>
</card>
<%
end if
else%>
<card id="login" title="登陆出错">
<p align="<%=const_index%>">
用户名或密码不对,或您未注册。<br/>
<a href="reg.asp">登陆</a>|<a href="reg.asp?Action=reg">注册</a><br/>
<a href="index.asp">智能首页</a><br/><a href="/wap/"> 网站首页</a><br/>
</p>
</card>
<% end if
end sub
sub save
name=utf8(Trim(Request("name")))
mobile=utf8(Trim(Request("mobile")))
pass=md5(Trim(utf8(Request("pass"))))
pass2=md5(Trim(utf8(Request("pass2"))))
IF name<>"" and pass<>"" and pass=pass2 and mobile<>"" then
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from wap_user where name='" & name&"'"
rs.open sql,conn,1,1
if not rs.eof then
if name=rs("name") then
%>
<card id="index" title="免费注册" ontimer="reg.asp?Action=reg"><timer value='30'/>
<p>
对不起,该用户已被注册。<br/>
<a href="reg.asp?Action=reg">返回注册</a><br/>
<a href="index.asp">智能首页</a><br/><a href="http://skwap.cn/wap"> 网站首页</a><br/>
</p>
</card>
<% end if
end if
set rs=Server.CreateObject("Adodb.Recordset")
rs.open "select * from wap_user order by id asc",conn,1,3
rs.addnew()
rs("name")=Name
rs("pass")=pass
rs("mobile")=mobile
rs.update
rs.MoveLast
session("name")= name
session("id")= rs("id")
%>
<card id="index" title="成功注册" ontimer="index.asp"><timer value='20'/>
<p>
恭喜,你已成功注册用户。<br/>
<a href="index.asp">马上进入</a><br/>
</p>
</card>
<%
rs.close
set rs=nothing
else
%>
<card id="index" title="注册用户" ontimer="reg.asp?Action=reg"><timer value='30'/>
<p>
对不起,用户名,密码和手机号不能为空。<br/>
<a href="reg.asp?Action=reg">返回注册</a><br/>
<a href="index.asp">智能首页</a><br/><a href="http://skwap.cn/wap"> 网站首页</a><br/>
</p>
</card>
<% end if
end sub%>
</wml>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -