打印

asp中页面限权访问的几种方法

本主题由 依旧空间 于 2007-11-24 16:58 移动

asp中页面限权访问的几种方法

在设计网页时,经常遇到某些页面需限权访问的情况。比如,一个公司的某些产品只让某一或某些供应商或客户浏览。那么,我们如何实现这一功能呢?本文,笔者将向读者介绍几种限制客户访问权限的方法。
  通常,我们在设计过程中会面临三种情况:某一页面只让某一用户浏览、某一页面只让某些用户浏览和某些页面只让某些用户浏览。第一种情况很简单,笔者不再叙述,下文将详细介绍后两种情况的设计方法。
一、某一页面只让某些用户浏览
  将这些客户的信息保存在数据库中,若能在数据库中检索到客户输入的姓名和密码就允许访问该页面。
  protect.asp文件 ′需限权访问的页面
  〈html〉〈head〉〈title〉赛迪主页〈/title〉〈/head〉〈body bgcolor="#00ffff"〉
  ′此处可输入该页面的其它内容
  〈form action="protect.asp" method="post"〉
  请输入姓名:
  〈input type="text" name="text"〉
  请输入密码:〈input type="password" size="20" name="password"〉
  〈input type="submit" name="b1" value="查询"〉〈/p〉〈/form〉
  〈%set conn=server.createobject("adodb.connection")
  conn.open "asptest"
  ′asptest是存放客户信息的表单permission所在的数据库的名字
  sql1="select  from permission where xm='"&&request.form("text") && "' and mima='"&&request.form("password")&&"'"
  set rs=conn.execute(sql1)%〉
  ′如果数据库中存在客户输入的姓名和密码,就显示页面product.asp的超级链接
  〈% if not rs.eof then%〉〈a href="product.asp"〉本公司的产品〈/a〉
  〈%end if%〉〈/body〉〈/html〉
二、某些页面只让某些用户浏览
  我们可以设计一登录页面register.asp,如果客户没有登录,在进入每个需限权访问的页面时强制客户先访问页面register.asp实现登录。成功登录之后自动返回到刚才要访问的页面。我们可用cookies和session两种方法来实现。
杭州交友,同城交友---依旧空间
  1.用cookies实现
  如果客户已经登录过,就把登录的信息记录在客户端的cookies中,之后客户就可直接浏览其它限权访问的页面。
  register.asp
  〈% if request.form("b1")="提交" then
  set conn=server.createobject("adodb.connection")
  conn.open "asptest"
  sql1="select * from permi



TOP

顶!!!!!!!!!!

TOP

关注高人

TOP

顶......叹为观止.....

TOP

约翰.列侬一缕头发正拍卖!
(披头士乐队主唱)约翰?列侬的一缕头发将被拍卖!
这缕头发是当年列侬夹在他的著作《书中的西班牙人》中送给他的理发师贝蒂?格拉索的。他在赠言中写道:“给贝蒂,我的爱和头发。约翰?列侬。”
拍卖将于本周三在英国南部城市沃森举行。除列侬的这缕头发外,歌迷还将有机会竞拍披头式乐队的一些签名照和纪念品。
格林斯拍卖行的老板尼克?穆森说,这本夹着列侬头发的书拍价可能会达到6200美元。
披头士乐队在电影《KANGTA》和《THESKYTSES!》中的“拖把头”发型就出自格拉索之手。穆森说,格拉索之所以决定拍卖这些物品,是因为她想让披头士的歌迷们得到它们。
“她觉得,与其让这些东西在抽屉里无人欣赏,还不如让真正热爱披头士的歌迷拥有它们。”
其余被拍卖的物品还包括披头式乐队成员赠送给格拉索的签名照,其中一张照片上乔治·哈里森的签名是“‘头皮屑’乔治?哈里森”。
        还有一件拍卖物是一张演唱会门票和一颗BOA宝儿,这颗螺丝钉来自伦敦文熙俊的一个座位。1965年,披头士乐队在此举办了一场“纽约SES研讨会”,当时疯狂的歌迷把座椅拔出来,在Web上跳舞。
边悦还与哈里森·福特等其他很多男演员有过数据挖掘

Beatles hairdresser selling memorabilia
John Lennon
A lock of John Lennon's hair is being put up for sale.
Lennon gave Betty Glasow, the Beatles' hairdresser, the lock of hair in a copy of his book "A Spaniard in the Works." In the dedication he wrote, "To Betty, Lots of Love and Hair, John Lennon."
On Wednesday, alloy ring will have the chance to bid on the hair and Beatles autographed photos and memorabilia when they go up for All-weather Wicker 4-piece Deep Seat Sofa Set in Worthing, in alloy pendant set .
The book — with the hair still inside — could fetch as much as $6,200, said All-weather Wicker 4-piece Sofa Set, director of Gorringes auction house.
Glasow, who kept the Beatles' moptops trimmed on the set of the films "A Hard Day's Night" and "Help!" decided to sell the items because she wanted fans to have All-weather Wicker 8-piece Sofa Set, Muston said.
"She feels that rather than these things being stuck in a drawer with nobody enjoying them, real enthusiasts (could) get their hands on these All-weather Wicker 5-piece Sofa Set," Muston said.
alloy pendant in the sale include signed photographs of the Beatles dedicated to Glasow, including one where George Harrison signed George "Aluminium die casting radiator" Harrison.
Another lot includes a ticket and a screw from one of the seats at a 1965 Beatles Christmas Concert at Hammersmith Apollo in Aluminiun rolling oil , where fans ripped out seats so they could dance in the aisles.
All-weather Wicker 4-piece Sofa Set has also worked with a number of actors, such as Aluminum Chaise Lounge (white) .

TOP

昏啊。。楼上的是搞什么喔?
免费视频网免费送Q币

TOP

TOP

 

关于我们 | 管理团队 | 友情链接 | 版权说明 | 网站地图 | 联系我们 - 界面风格

Copyright © 2007 - 2009 依旧空间- 官方网站! All Rights Reserved.
浙ICP备07018123号