怎样做到只有VIP会员才可以看到全部文章,普通会员只能看到一部分文章?

是这样的,显示文章的页面是news_detail.asp,我想在这个页面首行加入一个过滤页面check_vip.asp,数据库里面有个注册人员的表news_sort,有个字段为vip,普通会员为0,VIP会员为1;还有个表为news_purpose,有个字段为vipsign,文章让普通会员可以看到为0,只有VIP会员才能看到时为1,数据库连接文件为db_conn.asp,请问check_vip.asp这个页面应该怎么写才行。
---------------------------------------------------------------

if 条件 then
跳转到(会员可以看到的文章(取出标志为1的文章))
else
跳转到(一般人可以看到的文章(取出标志为0的文章))
end if

---------------------------------------------------------------

登录以后
if rs("vip")=1 then
session("vip")=1
else
session("vip")=0
end if

set rs=server.create("adodb.recordset")

if session("vip")=1 then
sql="select * from news_purpose where vipsign=1"
else
sql=="select * from news_purpose where vipsign=0"
end if

rs.open sql,conn,1,1
---------------------------------------------------------------

http://www.hengrun-group.com/hi-web.zip 现成的例子.
---------------------------------------------------------------

登录时获取登录者的身份,然后根据其身份调用数据

Published At
Categories with Web编程
Tagged with
comments powered by Disqus