?? qq_zc.asp
字號:
<!--#include file="conn.asp"-->
<htm>
<head>
<script language='javascript'>
function xgjc(mm,nc)
{
if(mm=="")
{alert('密碼不能為空!');
document.de.mm.focus();
return false;}
if(nc=="")
{alert('昵稱不能為空!');
document.de.nc.focus();
return false;}
if(mm.indexOf("'")>=0 ||mm.indexOf("<")>=0 ||mm.indexOf(">")>=0 ||mm.indexOf(".")>=0)
{
alert('不能有亂碼!');
document.de.mm.focus();
return false;
}}
function zcjc(yhm,mm,nc)
{
if(yhm=="")
{alert('用戶名不能為空!');
document.zc.yhm.focus();
return false;}
var aa ="";
aa = yhm.substring(0,1);
if((aa<='z'&&aa>='a')||(aa<='Z'&&aa>='A'))
{}
else
{alert('首位不是字母!');
document.zc.yhm.focus();
return false;}
if(yhm.indexOf("'")>=0 ||yhm.indexOf("<")>=0 ||yhm.indexOf(">")>=0 ||yhm.indexOf(".")>=0)
{alert('用戶名不能有亂碼!');
document.zc.yhm.focus();
return false;}
if(mm=="")
{alert('密碼不能為空!');
document.zc.mm.focus();
return false;}
if(mm.indexOf("'")>=0 ||mm.indexOf("<")>=0 ||mm.indexOf(">")>=0 ||mm.indexOf(".")>=0)
{alert('不能有亂碼!');
document.zc.mm.focus();
return false;}
if(nc=="")
{alert('昵稱不能為空!');
document.zc.nc.focus();
return false;}
}
</script>
<link rel="stylesheet" href="style.css" type="text/css">
<title>注冊</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<!--#include file="qq_wjt.asp"-->
<%cz=request.querystring("cz")
mm=request.form("mm")
yhm=request.form("yhm")
nc=request.form("nc")
xb=request.form("xb")
if cz="xgxg" and mm<>"" and yhm<>"" then
exec="update admin set pass='"+setpwd(mm)+"',nc='"+nc+"',xb='"+xb+"' where yhm='"+yhm+"'"
conn.execute exec
conn.close
session("qqpass") = mm
session("qqnc") = nc
session("qqxb")= xb%>
<script language='javascript'>
alert('恭喜,修改成功!');
window.location="qq.asp";
</script>
<%end if
if cz="zccg" and mm<>"" and yhm<>"" then
''判斷是否重復
set rs=server.createobject("adodb.recordset")
exec="select * from admin where yhm='"+yhm+"'"
rs.open exec,conn,1,1
if rs.eof then
yhm=xrzh(yhm)
exec="insert into admin (xb,yhm,pass,jb,sj,nc) values ('"+xb+"','"+yhm+"','"+setpwd(mm)+"','1','"+cstr(date())+"','"+nc+"')"
conn.execute exec
conn.close
session("qqyhm") = yhm
session("qqxb") = xb
session("qqjb") = "1"
session("qqpass") = mm
session("qqnc") = nc%>
<script language='javascript'>
alert('恭喜,申請成功!');
window.location="qq.asp";
</script>
<%else%>
<script language='javascript'>
alert('抱歉,此用戶名已經有人用了,請換名后重新申請!');
window.location="qq_zc.asp?cz=zc";
</script>
<%end if
end if%>
<p> </p>
<%if cz="" then%>
<form name="zc" action="qq_zc.asp?cz=zccg" method="post">
<table align="center">
<tr height="25">
<td>用戶名</td>
<td><input name="yhm" type="text" size="10" maxlength="10"></td>
</tr>
<tr height="25">
<td>密 碼</td>
<td><input name="mm" type="password" size="10" maxlength="10">
</td></tr>
<tr height="25">
<td>昵 稱</td>
<td><input name="nc" type="text" size="10" maxlength="10">
</td></tr>
<tr height="25"><td headers="25">性別</td>
<td><input type="radio" value="男" name="xb" checked>男
<input type="radio" value="女" name="xb">女</td></tr>
<tr height="25"><td align="center" colspan="2">
<input type="submit" name="sdfsd" value="注 冊" onclick="javascript:return zcjc(yhm.value,mm.value,nc.value);">
<input type="button" value="返 回" onClick="javascript:window.location='qq.asp';">
</td></tr>
</table>
</form>
<%else%>
<form name="de" action="qq_zc.asp?cz=xgxg" method="post">
<table align="center">
<tr height="25">
<td align="center" >用戶名:</td>
<td><input name="yhm" type="text" size="10" maxlength="10" value="<%=session("qqyhm")%>" readonly=""></td>
</tr>
<tr height="25">
<td align="center">新密碼:</td>
<td><input name="mm" type="password" size="10" maxlength="10" value="<%=setpwd(session("qqpass"))%>">
</td></tr>
<tr height="25"><td>昵 稱</td><td><input name="nc" type="text" size="10" maxlength="10" value="<%=session("qqnc")%>"></td></tr>
<tr height="25">
<td headers="25">性別</td>
<td><input type="radio" value="男" name="xb" <%if session("qqxb")="男" then response.write "checked"%>>男
<input type="radio" value="女" name="xb" <%if session("qqxb")="女" then response.write "checked"%>>女</td></tr>
<tr height="25"><td align="center" colspan="2">
<input type="submit" name="sdfsd" value="修 改" onclick="javascript:return xgjc(mm.value,nc.value);">
<input type="button" value="返 回" onClick="javascript:window.location='qq.asp';">
</td></tr>
</table>
</form>
<%end if%>
</body>
</htm>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -