会员登录代码

 

查看文章

 

 

会员登陆系统代码

2008-08-19 13:15

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

<!--#include file="config.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
无标题文档</title>
</head>

<body>
<h1>
ASP会员登退系统</h1>
<hr>

<!----ASP代码--->
<%

if request.querystring("act")="login" then '获取地址,成立则输出
'
登陆
sql="select * from uid where i_uid='"&request.form("i_uid")&"'"
sql=sql & "and i_code='"&request.form("i_code")&"'"
rst.open sql,conn,1,1


if rst.recordcount > 0 then
session("name")=rst("i_uid")
'
用这个session变量表示用户是否已经登陆
session("acc")=true

else
%>
用户密码出错,不能登陆
<%
end if
rst.close

elseif request.querystring("act")="loginout" then
'
退出登陆
session("name")=""
session("acc")=flase

end if
%>

<!--结束-->
<% if not session("acc") then %>

<form id="form1" name="form1" method="post" action="login.asp?act=login">
<p>
会员登陆:
    <input type="text" name="i_uid" id="i_uid" />
</p>
<p>
用户密码:
    <input type="text" name="i_code" id="i_code" />
</p>
<p>
    <input type="submit" name="button" id="button" value="
提交" />
    <input type="reset" name="button2" id="button2" value="
重置" />
        </p>
</form>

<%else %>
<%=session("name")%>
欢迎你回来
<p>

<a href="login.asp?act=loginout">退出登陆</a>

</p>
<% end if %>

<% if not session("acc") then%>
<p>
你还没有登陆,不能查看
</p>
<% else %>

<p>&nbsp;</p>
<table width="734" height="51" border="1">
<tr>
<%
rst.open "uid",conn,1,1
for i=0 to rst.fields.count-1
%>



    <td height="23">
字段名</td>
    <td>
字段类型</td>
    <td>
字段数据长度</td>
    <td>
允许存储的最大数字位</td>
</tr>
<tr>
    <td><%=rst.fields(i).name%></td>
    <td><%=rst.fields(i).type%></td>
    <td><%=rst.fields(i).actualsize%></td>
    <td><%=rst.fields(i).precision%></td>
</tr>
<%next%>

</table>
<%end if%>

<p>&nbsp;</p>

<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值