28,408
社区成员
发帖
与我相关
我的任务
分享<%
Action=Trim(request("Action"))
if Action="Login" then
dim sql
dim rs
dim usnames
dim pws
usnames=replace(trim(request("Username")),"'","") ‘更改
pws=replace(trim(Request("pws")),"'","")
pws=md5(pws)
set rs=server.createobject("adodb.recordset")
sql="select * from rz_userinfo where [usnames]='" & Username & "'"
rs.open sql,conn,1,3
if not rs.bof then
if pws=rs("pws") then
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs("LastLoginTime")=now()
rs("logins")=rs("logins")+1
rs.update
session("Username")=rs("usnames")
Response.Redirect "UserServer.asp"
else
response.write "密码错误"
response.end()
end if
else
response.write "没有找到相应的用户信息!"
response.end()
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%><%
Action=Trim(request("Action"))
if Action="Login" then
dim sql
dim rs
dim usnames
dim pws
usnames=replace(trim(request("Username")),"'","") ‘更改
pws=replace(trim(Request("pws")),"'","")
pws=md5(pws)
set rs=server.createobject("adodb.recordset")
sql="select * from rz_userinfo where [usnames]='" & Username & "' and pws='" & pws &"'" ’更改
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
if pws=rs("pws") then
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs("LastLoginTime")=now()
rs("logins")=rs("logins")+1
rs.update
session("Username")=rs("usnames")
Response.Redirect "UserServer.asp"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%>
<%
strSQLServer="RZSERVER"
strSQLUser="sa"
strSQLPassword="sa"
strSQLDataBase="RzQueue"
connstr = "driver={SQL Server};server=" & strSQLServer & ";UID=" & strSQLUser & ";PWD=" & strSQLPassword & ";database=" & strSQLDataBase & ""
set conn = server.createobject("ADODB.CONNECTION")
if err.number<>0 then
err.clear
set conn=nothing
response.write "<script>alert('创建 ADO 对象失败');</script>"
response.end
else
conn.open connstr
if err.number<>0 then
err.clear
set conn=nothing
response.write "<script>alert('SQL Server 数据库连接失败');</script>"
response.end
end if
end if
%>
<%
'sql="select * from config"
'Set rs= Server.CreateObject("ADODB.Recordset")
'rs.open sql,conn,1,1
%>
<!--#include file="const.asp" -->
<!--#include file="md5.asp"-->
<script language=javascript>
function CheckForm()
{
if(document.UserLogin.Username.value=="")
{
alert("请输入用户名!");
document.UserLogin.Username.focus();
return false;
}
if(document.UserLogin.pws.value == "")
{
alert("请输入密码!");
document.UserLogin.pws.focus();
return false;
}
}
</script>
<%
Action=Trim(request("Action"))
if Action="Login" then
dim sql
dim rs
dim usnames
dim pws
usnames=replace(trim(request("usnames")),"'","")
pws=replace(trim(Request("pws")),"'","")
pws=md5(pws)
set rs=server.createobject("adodb.recordset")
sql="select * from rz_userinfo where [usnames]='" & usnames & "' and pws='" & pws &"'"
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
if pws=rs("pws") then
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs("LastLoginTime")=now()
rs("logins")=rs("logins")+1
rs.update
session("Username")=rs("usnames")
Response.Redirect "UserServer.asp"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" >
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table Class=border width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="206" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="title_left" height="32"> 会
员 中 心</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD> <%If Session("Username")="" Then%>
<table width="100%" border="0" cellpadding="0" cellspacing="3">
<!--DWLayoutTable-->
<tr>
<td height="13" colspan="2" align="right"> <p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"> </p></td>
</tr>
<tr>
<td height="126" colspan="2" align="right"> <div align="center">
<table class="main" cellSpacing="0" cellPadding="2" width="100%" border="0" height="1">
<tbody>
<tr>
<td width="100%" height="1"><table width='40%' border='0' align="center" cellpadding='0' cellspacing='0' class="tdbg_left">
<form action='UserServer.asp?Action=Login' method='post' name='UserLogin' onSubmit='return CheckForm();'>
<tr class='title'>
<td height='25' colspan="2" align='right'><div align="center">用户登录</div></td>
</tr>
<tr>
<td height='25' align='right'>用户名:</td>
<td> <input name='Username' type='text' id='Username' size='20' maxlength='20'></td>
</tr>
<tr>
<td height='25' align='right'>密 码:</td>
<td> <input name='pws' type='password' id='pws' size='21' maxlength='20'></td>
</tr>
<tr align='center'>
<td height='25' colspan='2'> <input name='Login' type='submit' id='Login' value=' 登录 '>
<input name='Reset' type='reset' id='Reset' value=' 清除 '></td>
</tr>
<tr>
<td height='20' colspan='2' align='center'><a href='UserReg.asp' target='_blank'>用户注册</a> <a href='GetPassword.asp' target='_blank'>忘记密码</a></td>
</tr>
</form>
</table></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
<tr>
<td width="164" height="19" align="right"> </td>
<td width="583" align="right"> </td>
</tr>
<tr>
<td height="19" align="right" valign="top"> <p align="center" style="word-spacing: 0; margin-top: 0; margin-bottom: 0"> </p></td>
<td align="right" valign="top"><div align="left">您无法进入会员中心,请先登录!如果您不是我们的会员,请立即<font color="#006699"><a href="UserReg.asp"><font color="#FF0000">注册</font></a>。</font></div></td>
</tr>
<tr>
<td height="13" align="right"> </td>
<td> </td>
</tr>
</table>
<%else%>
<TABLE width="85%" align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR vAlign=top >
<TD width="100%"> <p style="margin-bottom: 0">
<br>
亲爱的<%=Session("Username")%>:</p>
<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
</p>
<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
您现在已经进入会员服务中心,这里只有注册会员才能访问。您可在这里修改您的注册信息、获取预约号码。</p>
<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
</p>
<p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
<a href="UserEditPwd.asp">修改密码</a>
<a href="UserEdit.asp">修改会员资料</a>
<a href="UserLogout.asp">退出登录</a></p></TD>
</TR>
</TBODY>
</TABLE>
<%end if%> </TD>
</TR>
</table> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</BODY></HTML>CREATE TABLE [rz_userinfo] (
[id] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[usnames] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[pws] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[sex] [nchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[email] [nchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[tel] [nchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[code] [nchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[regdate] [nchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
[LoginIP] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
[LastLoginTime] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
[logins] [ntext] COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO