Dreamweaver8 没有用户身份验证怎么办

来源:百度知道 编辑:UC知道 时间:2024/06/18 22:20:07
怎么解决这个问题???
怎么写啊???????????????

不可能没有的
没有也不要紧,自己手动写喽,很简单,不过对SESSION进行验证罢了
身份验证,无非就是在会员或者管理员登陆时才需要验证,看是否有用户名和密码。
以ASP为例:
假定用户名输入框ID为username
密码输入框ID为userpwd
在登陆后,直接将两个值给session
<%
username=request("username")
userpwd=request("userpwd")
session("username")=username
session("userpwd")=userpwd
%>
保存它们为一个ASP页,这样,在每页都用include来调用这页。
然后,在登陆后的页里,首先查询数据库
假定你的会员表名为user,存放会员名的字段为username,存放会员密码的字段为userpwd
<%
username=session("username")
userpwd=session("userpwd")
sql="select * from user where username='"username"' and userpwd='"userpwd"'"
rs.open sql,conn,1,1
if rs.eof then
response.write("用户名或密码错误")
end if
%>
具体代码自己写吧,只是给出方法。