?? index.asp
字號:
<%Response.Buffer=True%>
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file=md5.asp -->
<%
call erdown()
if session("netname")="" then
if request("action")="chk" then
call tjip()
name=trim(request("name"))
pwd=MD5(trim(request("pwd")))
if name="" or trim(request("pwd"))="" then
response.redirect "index.asp?error=1"
response.end
end if
if len(name)>10 or len(trim(request("pwd")))>10 then
response.redirect "index.asp?error=2"
response.end
end if
set rs=conn.execute("select name,pwd,admin from [user] where name='"&name&"' and pwd='"&pwd&"'")
if rs.eof and rs.bof then
response.redirect "index.asp?error=3"
response.end
else
conn.execute("update [user] set logintime=Now() where name='"&name&"'")
session("netname")=rs(0)
if rs(2)=True then
session("chatadmin")=True
end if
chatmatname=split(mastername,"|")
for i=0 to UBound(chatmatname)
if session("netname")=chatmatname(i) then
gjmaster=True
end if
next
if gjmaster=True then
session("chatadmin")=True
end if
end if
rs.close
set rs=nothing
response.redirect "index.asp"
end if
if request("action")="reg" then
call tjip()
name=trim(request("name"))
pwd=MD5(trim(request("pwd")))
rpwd=MD5(trim(request("rpwd")))
sex=trim(request("sex"))
qq=trim(request("qq"))
email=trim(request("email"))
face=trim(request("face"))
if name="" or trim(request("pwd"))="" or qq="" or email="" then
response.write "<script language=javascript>{window.alert('請將資料填寫完整!');window.history.go(-1);}</script>"
response.end
end if
if len(name)<2 or len(name)>10 then
response.write "<script language=javascript>{window.alert('用戶名長度為2-10位!');window.history.go(-1);}</script>"
response.end
end if
if pwd<>rpwd then
response.write "<script language=javascript>{window.alert('兩次密碼不一致!');window.history.go(-1);}</script>"
response.end
end if
if len(trim(request("pwd")))<4 or len(trim(request("pwd")))>10 then
response.write "<script language=javascript>{window.alert('用戶密碼長度為4-10位!');window.history.go(-1);}</script>"
response.end
end if
if len(qq)<4 or len(qq)>10 then
response.write "<script language=javascript>{window.alert('QQ號碼長度為4-10位!');window.history.go(-1);}</script>"
response.end
end if
if not IsValidEmail(email) then
response.write "<script language=javascript>{window.alert('E-mail地址錯誤!');window.history.go(-1);}</script>"
response.end
end if
set rs=conn.execute("select name from [user] where name='"&name&"'")
if not rs.eof and not rs.bof then
response.write "<script language=javascript>{window.alert('對不起,此用戶名已注冊!');window.history.go(-1);}</script>"
response.end
else
sql="insert into [user] (name,pwd,sex,qq,email,face,admin,regtime) values('"&name&"','"&pwd&"','"&sex&"','"&qq&"','"&email&"','"&face&"',False,Now())"
conn.execute(sql)
response.redirect "index.asp?reg=True"
end if
rs.close
set rs=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>看吧聽吧聊吧-<%=chatname%>--登陸</title>
<style>
td,input,select{font-family:宋體,arial; font-size:12px; color:#000000}
td.setwhite{color:#ffffff;line-height:150%}
A:link { font-size:12px; text-decoration:none; color: #ffffff}
A:visited { font-size:12px; text-decoration:none; color: #ffffff}
A:hover { font-size:12px; text-decoration:underline; color: #ffffff}
.input1 { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 12px; BACKGROUND: #FFFFFF; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 18px}
.input2 { BORDER-RIGHT: #0099cc 1px solid; BORDER-TOP: #0099cc 1px solid; FONT-SIZE: 12px; BACKGROUND: #FFFFFF; BORDER-LEFT: #0099cc 1px solid; BORDER-BOTTOM: #0099cc 1px solid; HEIGHT: 18px}
.p9 { font-size:9pt;BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; HEIGHT: 18px; BACKGROUND-COLOR: #cccccc; BORDER-RIGHT-WIDTH: 1px}
body {
background-image: url(200547121325856.jpg);
background-color: #E6E6F2;
}
.style1 {color: #000000}
</style>
<script language="JavaScript">
var errtimeID = null;
function updatemsg(omsg,errtime)
{
if (errtimeID==null){
msgbox.innerHTML = "<font color=red>" + omsg + "</font>";
errtimeID = setTimeout("updatemsg()",errtime);
} else {
clearTimeout(errtimeID);
msgbox.innerHTML = " ";
errtimeID = null;
}
}
function checkform()
{
if(document.login.name.value==""){
window.alert("請輸入您的用戶名!");
document.login.name.focus();
return false ;
}
if(document.login.pwd.value==""){
window.alert("請輸入您的密碼!");
document.login.pwd.focus();
return false ;
}
return true;
}
function isEmail(vEMail)
{
var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
return (!regInvalid.test(vEMail)&®Valid.test(vEMail));
}
function checkform1()
{
if(document.reg.name.value==""){
window.alert("請輸入您的用戶名!");
document.reg.name.focus();
return false ;
}
if(document.reg.name.value.length<2){
window.alert("用戶名長度在2-6位之間!");
document.reg.name.focus();
return false ;
}
if(document.reg.pwd.value==""){
window.alert("請輸入您的密碼!");
document.reg.pwd.focus();
return false ;
}
if(document.reg.pwd.value.length<4){
window.alert("用戶密碼長度在4-10位之間!");
document.reg.pwd.focus();
return false ;
}
if(document.reg.rpwd.value==""){
window.alert("請輸入您的驗證密碼!");
document.reg.rpwd.focus();
return false ;
}
if(document.reg.rpwd.value!=document.reg.pwd.value){
window.alert("兩次密碼輸入不一致!");
document.reg.rpwd.focus();
return false ;
}
if(document.reg.rpwd.value==""){
window.alert("請輸入您的驗證密碼!");
document.reg.rpwd.focus();
return false ;
}
if(document.reg.qq.value==""){
window.alert("請輸入您的QQ號碼!");
document.reg.qq.focus();
return false ;
}
if(document.reg.qq.value.length<4){
window.alert("QQ號碼長度在4-10位之間!");
document.reg.qq.focus();
return false ;
}
if(document.reg.email.value==""){
window.alert("請輸入您的E-mail號碼!");
document.reg.email.focus();
return false ;
}
if(!isEmail(document.reg.email.value))
{
window.alert("請輸入正確的郵件格式!");
document.reg.email.focus();
return false;
}
return true;
}
function select_radio(info)
{
cmp_displayc.style.display='none';
ind_displayc.style.display='none';
if(info=='注冊')
{
cmp_displayc.style.display='';
}
if(info=='登陸')
{
ind_displayc.style.display='';
}
}
function ignoreSpaces(string) {
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}
</script>
</head>
<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0>
<center>
<table width=410 border=0 height=100% cellpadding=0 cellspacing=0>
<tr>
<td>
<table border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#0099cc" width="410" id="cmp_displayc" style="DISPLAY:none">
<form method="post" action="index.asp?action=reg" name="reg" onSubmit="return checkform1()">
<tr>
<td bgcolor=#99ccff colspan=2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><img src="images/arrow.gif" width="13" height="13"> 新用戶注冊</td>
<td width="100" align="right"><input type="radio" name="new" onclick="javascript:select_radio('登陸')" id="1"> <label for="1"><span style="CURSOR:hand">登 陸</span></label>
</td>
</tr>
</table>
</td>
</tr>
<TR>
<TR bgcolor="#f2f8ff">
<TD width="20%" align=right><font color=red>*</font>用 戶 名:</TD>
<TD width="80%"><input name="name" class="input2" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);"> 用戶名長度2-10位</TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD width="20%" align=right><font color=red>*</font>用戶密碼:</TD>
<TD width="80%"><input type="password" name="pwd" class="input2" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);"> 用戶密碼長度4-10位</TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD width="20%" align=right><font color=red>*</font>確認密碼:</TD>
<TD width="80%"><input type="password" name="rpwd" class="input2" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);"></TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD width="20%" align=right><font color=red>*</font>性 別:</TD>
<TD width="80%">
<input type="radio" name="sex" value="男" checked id="2"> <label for="2">男</label>
<input type="radio" name="sex" value="女" id="3"> <label for="3">女</label>
</TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD align=right width="20%"><font color=red>*</font>QQ號碼:</TD>
<TD width="80%"><input name="qq" class="input2" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"> QQ號碼長度4-10位</TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD align=right width="20%"><font color=red>*</font>E-mail:</TD>
<TD width="80%"><input name="email" class="input2" maxlength="30" onBlur="this.value=ignoreSpaces(this.value);"></TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD align=right width="20%">頭 像:</TD>
<TD width="80%">
<select name="face" onChange="document.images['face'].src=options[selectedIndex].value;">
<%for i=1 to 35
facestr="face/"&i&".gif"
Response.Write "<option value='"&facestr&"'>頭像" &i &"</option>"
next%>
</select>
<img id=face src="face/1.gif">
<a href="allface.asp" target="_blank"><font color="#000000">查看頭像列表</font></a>
</TD>
</TR>
<TR bgcolor="#f2f8ff">
<TD colSpan=2 height="31" align=middle>
<input type="submit" value="提 交" style="CURSOR: hand" class="p9">
<input type="reset" value="重 填" style="CURSOR: hand" class="p9">
</TD>
</TR></FORM></TABLE>
<table width=410 border=0 cellpadding=0 cellspacing=0 id="ind_displayc" style="DISPLAY:">
<tr>
<td width=151 height=45> </td>
<td width=223 bgcolor="#66CCCC">
<span class="style1">在線列表</span>
<%
online=Application("onlinelist")
online=split(online," ")
%>
<select>
<option>當前共有<%if ubound(online)<0 then%><%=ubound(online)+1%><%else%><%=ubound(online)%><%end if%>人在線</option>
<%for i=lbound(online) to ubound(online)-1%>
<option><%=online(i)%></option>
<%next%>
</select>
</td>
<td width=36> </td>
</tr>
<tr>
<td height=83> </td>
<form action="index.asp?action=chk" method="post" onSubmit="return checkform()" name="login">
<td bgcolor="#E7E7E7" class="setwhite">
<table width=100% border=0 cellpadding=0 cellspacing=0 height=100%>
<tr><td align=center bgcolor="#E7E7E7">
<span class="style1">用 戶 名:</span>
<input name="name" size="15" class="input1" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);">
</td>
</tr>
<tr><td align=center bgcolor="#E7E7E7">
<span class="style1">用戶密碼:</span>
<input type="password" name="pwd" size="15" class="input1" maxlength="10" onBlur="this.value=ignoreSpaces(this.value);">
</td>
</tr>
<tr><td align=center bgcolor="#E7E7E7">
<input type="submit" style="CURSOR:hand" class="p9" value="登 陸">
<input type="radio" name="new" onclick="javascript:select_radio('注冊')" id="0">
<span class="style1">
<label for="0">新會員注冊</label>
</span> </td>
</tr>
</table>
</td>
</form>
<td> </td>
</tr>
<tr>
<td height=35> </td>
<%
set rs=conn.execute("select count(*) from [user]")
count=rs(0)
rs.close
set rs=nothing
%>
<td bgcolor="#66CCCC"><span class="style1">
共有注冊人數11<%=count%>位</span></td>
<td> </td>
</tr>
</table>
<table border=0 width=100% cellpadding=0 cellspacing=0>
<tr><td height=30 align=center><div id="msgbox"></div></td></tr>
<tr>
<td height=20 align=center>Copyright © 2006 Powered By:<%=copy%> <a href="http://www.haoiis.com" target="_blank">免費空間由上海豪網提供</a></td>
</tr>
<tr><td height=20><br></td></tr>
</table>
</td>
</tr>
</table>
</center>
<script language="javascript">
<%if request("error")=1 then%>
var errmsg = "對不起,用戶名或密碼不能為空!";
<%elseif request("error")=2 then%>
var errmsg = "用戶名或密碼的長度不能超過10!";
<%elseif request("error")=3 then%>
var errmsg = "用戶名或密碼錯誤!";
<%elseif request("reg")="True" then%>
var errmsg = "恭喜您,注冊成功!";
<%else%>
var errmsg = " ";
<%end if%>
if (errmsg && errmsg!="") updatemsg(errmsg,3000);
</script>
</body>
</html>
<%
else
response.write "<script language=javascript>{window.open('chat.asp','_blank','width=1000,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,menu=no,min=no,max=no');}</script>"
response.end
end if
conn.close
set conn=nothing
%>
<script src="http://www.haoiis.com/js/ad-01.js" language="JavaScript"></script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -