我的原程序是,如何实现在首页通过验证后操作.....留言、联系我,比如:
导航栏中----->首页 留言 联系我
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<p> </p>
<form name="form2" method="post" action="">
<table width="760">
<tr>
<td>首页</td>
<td>留言板</td>
<td>联系我</td>
</tr>
</table>
</form>
<p>
<!-- #include file="include.inc.asp"-->
<a href="uu.asp?act=loginout" class="STYLE7">
<%
set rst=server.createobject("adodb.recordset")
if request.querystring("act")="login" then
'登录
sql="select * from uset where t_name='" & request.form("h_name") & "'"
sql=sql & " and t_pass='" & request.form ("h_pass") & "'"
rst.open sql,conn,1,1
if rst.recordcount>0 then
session("uset")=rst("t_name")
session("acc")=true
else
response.write "用户名或密码错误!"
end if
rst.close
else if
request.querystring("act")="loginout" then
session("uset")=""
session("acc")=false
end if
if not session("acc") then
%>
</a>
</p>
<p><a href="uu.asp?act=loginout" class="STYLE7">请登录</a></p>
<form id="form1" name="form1" method="post" action="uu.asp?act=login">
<a href="uu.asp?act=loginout" class="STYLE7">
<label>用户名
<input type="text" name="h_name">
<br>
<br>
密码
<input type="text" name="h_pass">
<br>
<br>
<br>
<input type="submit" name="Submit" value="登录">
</label>
</a>
<p> <a href="uu.asp?act=loginout" class="STYLE7">
<%
else
%>
<%
end if
%>
</a>
</form>
<p> </p>
</div></td>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="left"> </p>
<p align="left"></p>
<p></p>
<%
set rst=nothing
conn.close
set conn=nothing
%>
<%
end if
%>
</body>
</html>