代码错误,找不出错误原因
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>主页</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-repeat: no-repeat;
}
-->
</style></head>
<body>
<table width="800" height="442" border="0" align="center" cellspacing="0">
<tr>
<td height="442" align="center" valign="top" background="img/zybeijing.jpg" bgcolor="#FFFFFF"><table width="800" height="429"
border="0" cellspacing="0">
<tr>
<td width="229" height="69"> </td>
<td width="359"> </td>
<td width="206"> </td>
</tr>
<tr>
<td height="68"> </td>
<td align="left" valign="middle"><img src="img/dlz.jpg" width="168" height="46" /></td>
<td> </td>
</tr>
<tr>
<td height="238"> </td>
<td align="center" valign="middle" background="img/du.jpg">
<!--include file="db_inc.asp"-->
<%
set rst=server.createobject("adodb.recordset")
if request.Querystring("act")="login" then
'登陆
sql="select * from user where u_user='" & request.form("f_user") & "'"
sql=sql & " and u_code='" & request.form("f_code") & "'"
rst.open sql,conn,1,1
if rst.recordcount>0 then
session("user")=rst("u_user")
'用这个SESSION变量表示用户是否已经登陆
session("acc")=true
else
response.write "用户或密码错误,不能登陆"
end if
rst.close
elseif request.QueryString("act")="loginout" then
'退出登陆
session("user")=""
session("acc")=false '注意假的写法
end if
%>
<%
if not session("acc") then
%>
<form id="form1" name="form1" method="post" action="?act=login">
用户名:
<input name="f_user" type="text" id="f_user" />
<br />
密 码:
<input name="f_code" type="password" id="f_code" />
<br />
<input type="submit" name="Submit" value="登录" />
</form>
<%
else
%>
<%=session("user")%>, 欢迎你再次到来!<br />
<a href="login.asp?act=loginout">退出登录</a>
<%
end if
%>
</td>
<td> </td>
</tr>
<tr>
<td height="28"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="26" colspan="3" align="right" valign="bottom" style="border-left-width: 1px; border-right-width: 1px; border-top
-width: 1px; border-bottom-style: dotted; border-bottom-width: 1px" bordercolor="#FFFFFF"> </td>
</tr>
</table></td>
</tr>
</table>
<table width="800" height="687" border="0" align="center" cellspacing="0">
<tr>
<td height="687" align="center" valign="top" background="img/zcym1.jpg" bgcolor="#FFFFFF"><table width="800" border="0"
cellspacing="0">
<tr>
<td width="84" height="225"> </td>
<td width="670"> </td>
<td width="40"> </td>
</tr>
<tr>
<td height="358"> </td>
<td align="center" valign="middle">
<%
if not session("acc") then
%>
您还没有登录,不能查看会员功能!<br />
<%
else
%>
会员数据库USER表结构如下:
<table width="80%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="24%" align="center">字段名</td>
<td width="21%" align="center">字段类型</td>
<td width="22%" align="center">字段数据长度</td>
<td width="33%" align="center">允许存储的最大数字位</td>
</tr>
<tr>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
</table>
<%
end if
%>
<br /></td>
<td> </td>
</tr>
<tr>
<td height="66" colspan="3" align="center" valign="bottom"> </td>
</tr>
</table></td>
</tr>
</table>
<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>